> 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: ChunkSplitBySize~~

[Performance.chunkSplit](/next/zh/api/packages/rspeedy/interfaces/Performance.md#chunksplit) 用于配置 chunk 拆分策略。

## Deprecated

请使用顶层的 [Config.splitChunks](/next/zh/api/packages/rspeedy/interfaces/Config.md#splitchunks) 选项代替。

## Properties

### ~~maxSize?~~

> `optional` **maxSize?**: `number`

chunk 的最大体积，单位为字节。

#### Default Value

`Number.POSITIVE_INFINITY`

#### Example

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

export default defineConfig({
  performance: {
    chunkSplit: {
      strategy: 'split-by-size',
      maxSize: 50000,
    },
  },
})
```

***

### ~~minSize?~~

> `optional` **minSize?**: `number`

chunk 的最小体积，单位为字节。

#### Default Value

```ts
10000
```

#### Example

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

export default defineConfig({
  performance: {
    chunkSplit: {
      strategy: 'split-by-size',
      minSize: 20000,
    },
  },
})
```

***

### ~~override?~~

> `optional` **override?**: `false` | `OptimizationSplitChunksOptions`

可以指定自定义的 Rspack chunk 拆分配置。

#### Default Value

```ts
undefined
```

***

### ~~strategy~~

> **strategy**: `"split-by-size"`

chunk 拆分策略。

#### Remarks

- `split-by-experience`（Rsbuild 默认）：根据经验制定的拆分策略，自动将一些常用的 npm 包拆分为体积适中的 chunk。

- `split-by-module`：按 NPM 包的粒度拆分，每个 NPM 包对应一个 chunk。

- `split-by-size`：根据模块大小自动拆分。

- `all-in-one`：将所有代码打包到一个 chunk 中。

- `single-vendor`：将所有 NPM 包打包到单个 chunk 中。

- `custom`：自定义 chunk 拆分策略。
