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

# environments

> `optional` **environments?**: `Record`\<`string`, `EnvironmentConfig`>

:::info Lynx default override
This is an Rsbuild option whose default is overridden by `pluginLynx`. The default shown below applies when using the plugin. Set this option at the top level of `rsbuild.config.ts`; an explicit value takes precedence.

[See the Rsbuild reference for the full option behavior](https://rsbuild.rs/config/environments).
:::

The [Config.environments](/next/api/packages/rspeedy/interfaces/Config.md#environments) option is used to set the output environment.

## Default Value

When this option is unset, Rspeedy passes `{ lynx: {} }` to Rsbuild.

## Remarks

Normally you don't need this if you are not using Lynx for Web.

## Examples

- Using different entries for Lynx and Web.

```ts
import { defineConfig } from '@lynx-js/rspeedy'

export default defineConfig({
  environments: {
    lynx: {},
    web: {
      source: { entry: { web: './src/index.web.jsx' } },
    },
  },
  source: {
    entry: './src/index.jsx',
  },
})
```

- Building Web-only outputs.

```ts
import { defineConfig } from '@lynx-js/rspeedy'

export default defineConfig({
  environments: {
    web: {
      source: { entry: { web: './src/index.web.jsx' } },
    },
  },
})
```
