> 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: LynxConfig

**`Beta`**

`pluginLynx` 暴露给其他插件的 Lynx 配置。

## Remarks

该数据与 [LynxPluginOptions](/next/zh/api/packages/rsbuild-plugin/interfaces/LynxPluginOptions.md) 保持一致，因此插件读取
`config.output.filename` 的方式与从
`api.getRsbuildConfig()` 读取 `output.filename` 相同。依赖于当前构建入口的值由方法推导得出，这些方法随数据一起传递，从而确保始终由构建该配置的插件来解析这些值。

## Example

```js
const lynx = getLynxConfig(api)
const filename = lynx.resolveBundleFilename({
  entryName: 'main',
  platform: environment.name,
})
```

## Properties

### output

> `readonly` **output**: [`LynxOutput`](/next/zh/api/packages/rsbuild-plugin/interfaces/LynxOutput.md)

**`Beta`**

构建产物。

***

### performance

> `readonly` **performance**: [`LynxPerformance`](/next/zh/api/packages/rsbuild-plugin/interfaces/LynxPerformance.md)

**`Beta`**

性能选项。

## Methods

### resolveBundleFilename()

> **resolveBundleFilename**(`context`: `object`): `string`

**`Beta`**

解析入口的 bundle 文件名。

#### Parameters

| Parameter           | Type                                              | Description |
| ------------------- | ------------------------------------------------- | ----------- |
| `context`           | \{ `entryName`: `string`; `platform`: `string`; } | 要解析文件名的入口。  |
| `context.entryName` | `string`                                          | -           |
| `context.platform`  | `string`                                          | -           |

#### Returns

`string`

***

### resolveIntermediateDir()

> **resolveIntermediateDir**(`context?`: `object`): `string`

**`Beta`**

解析中间产物所在的目录。

#### Parameters

| Parameter            | Type                         | Description                      |
| -------------------- | ---------------------------- | -------------------------------- |
| `context?`           | \{ `entryName?`: `string`; } | 要解析目录的入口。不传入口名时，返回存放所有入口目录的那个目录。 |
| `context.entryName?` | `string`                     | -                                |

#### Returns

`string`

#### Remarks

Lynx bundle 由各线程的 JS、CSS 和 HMR 产物编码而成。这些产物按入口输出到该目录中，而不是与 bundle 放在一起。

***

### resolveLazyBundleFilename()

> **resolveLazyBundleFilename**(`context`: `object`): `string` | `undefined`

**`Beta`**

解析 lazy bundle 文件的名称。

#### Parameters

| Parameter          | Type                       | Description          |
| ------------------ | -------------------------- | -------------------- |
| `context`          | \{ `platform`: `string`; } | 要解析文件名的 environment。 |
| `context.platform` | `string`                   | -                    |

#### Returns

`string` | `undefined`

解析得到的名称；当 [LynxFilename.bundle](/next/zh/api/packages/rsbuild-plugin/interfaces/LynxFilename.md#bundle) 不是函数时为 `undefined`。lazy bundle 的名称是按异步 chunk 解析的，只能通过函数自定义，因此 `undefined` 表示调用方把命名交给 `LynxTemplatePlugin`。

#### Remarks

此时没有可用于解析 `[name]` 的入口名称，因此保留该占位符，由 `LynxTemplatePlugin` 按异步 chunk 填充。
