> For AI agents: the complete documentation index is available at /next/zh/llms.txt, the full documentation bundle is available at /next/zh/llms-full.txt.

# Interface: CreateRspeedyOptions

`createRspeedy` 方法的选项。

## Properties

### callerName?

> `optional` **callerName?**: `string`

当前调用 Rsbuild 的框架或工具的名称。插件可以据此根据调用上下文调整自身行为。

#### Example

Rsbuild 插件可以通过 `api.context.callerName` 访问该值。

```js
export function myPlugin() {
  return {
    name: 'my-plugin',
    setup(api) {
      // Log the name of the tool invoking Rsbuild
      console.log(`Called by: ${api.context.callerName}`);

      // Conditionally apply plugin logic based on caller
      if (api.context.callerName === 'rspeedy') {
        api.modifyRsbuildConfig((config) => {
          // Apply rspeedy-specific config changes
          return config;
        });
      } else if (api.context.callerName === 'rslib') {
        api.modifyRsbuildConfig((config) => {
          // Apply rslib-specific config changes
          return config;
        });
      }
    }
  };
}
```

#### Default Value

```ts
'rspeedy'
```

***

### cwd?

> `optional` **cwd?**: `string`

当前构建的根路径。

***

### environment?

> `optional` **environment?**: `string`\[]

仅构建指定的 environment。例如，传入 `['lynx']` 将只构建 `lynx` environment。如果未指定或传入空数组，则会构建所有 environment。

#### See

[https://rsbuild.rs/guide/advanced/environments#build-specified-environment](https://rsbuild.rs/guide/advanced/environments#build-specified-environment)

#### Default Value

```ts
[]
```

***

### loadEnv?

> `optional` **loadEnv?**: `boolean` | `LoadEnvOptions`

Rspeedy 默认会通过 [Rsbuild API](https://rsbuild.rs/api/javascript-api/core#load-env-variables) 自动加载 .env 文件。你可以在代码中通过 `import.meta.env.FOO` 或 `process.env.Foo` 访问 .env 文件中定义的环境变量。

#### See

[https://rsbuild.rs/guide/advanced/env-vars#env-file](https://rsbuild.rs/guide/advanced/env-vars#env-file)

#### Default Value

```ts
true
```

***

### rspeedyConfig?

> `optional` **rspeedyConfig?**: [`Config`](/next/zh/api/packages/rspeedy/interfaces/Config.md)

Rspeedy 的配置。
