Skip to content

Commit 5318eec

Browse files
authored
docs: add parallel code splitting docs (#9051)
1 parent 1c0a097 commit 5318eec

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

website/docs/en/config/experiments.mdx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,23 @@ Currently, incremental for the `make` and `emitAssets` stages is enabled by defa
307307
This feature is experimental. You can check its relevant progress at [rspack#8106](https://github.com/web-infra-dev/rspack/issues/8106). You can also report bugs and any related feedback here.
308308
:::
309309

310+
## experiments.parallelCodeSplitting
311+
312+
<ApiMeta addedVersion="1.2.0" />
313+
314+
- **Type:** `boolean`
315+
- **Default:** `false`
316+
317+
Enabling this configuration will activate a new multi-threaded code splitting algorithm. If your project includes many dynamic imports, this can greatly reduce the time spent on the code splitting process. In the future, Rspack will have this enabled by default.
318+
319+
```js title="rspack.config.js"
320+
module.exports = {
321+
experiments: {
322+
parallelCodeSplitting: true,
323+
},
324+
};
325+
```
326+
310327
## experiments.rspackFuture
311328

312329
- **Type:** `object`

website/docs/zh/config/experiments.mdx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,23 @@ module.exports = {
305305
该特性属于实验性特性,可前往 [rspack#8106](https://github.com/web-infra-dev/rspack/issues/8106) 查看其相关进度,也可在此 issue 中反馈 bugs 以及任何与之相关的反馈信息。
306306
:::
307307

308+
## experiments.parallelCodeSplitting
309+
310+
<ApiMeta addedVersion="1.2.0" />
311+
312+
- **类型:** `boolean`
313+
- **默认值:** `false`
314+
315+
开启后会启用新的多线程 code splitting 算法,如果你的项目中包含较多的动态引用,开启后可以显著降低 code splitting 阶段耗时,在未来 Rspack 会默认开启这个配置项。
316+
317+
```js title="rspack.config.js"
318+
module.exports = {
319+
experiments: {
320+
parallelCodeSplitting: true,
321+
},
322+
};
323+
```
324+
308325
## experiments.rspackFuture
309326

310327
- **类型:** `object`

0 commit comments

Comments
 (0)