Skip to content

Commit 001571c

Browse files
authored
docs: add docs for experiements.deferImport (#12018)
1 parent 90a4576 commit 001571c

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

website/docs/en/config/experiments.mdx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -895,3 +895,12 @@ A side-effect-free module is a module that meets one of the following conditions
895895
:::
896896

897897
> For more details, see [RFC: Lazy make for reexports in side effects free barrel file](https://github.com/web-infra-dev/rspack/discussions/11273)
898+
899+
## experiments.deferImport
900+
901+
<ApiMeta addedVersion="1.6.0" />
902+
903+
- **Type:** `boolean`
904+
- **Default:** `false`
905+
906+
When enabled, Rspack will support bundling the [Deferred Imports Evaluation](https://github.com/tc39/proposal-defer-import-eval) proposal, which allows deferring the evaluation of a module until its first use. Currently, only `import defer * as ns from "./module"` is supported, while `import.defer()` will be supported in future versions.

website/docs/zh/config/experiments.mdx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -896,3 +896,12 @@ export default {
896896
:::
897897

898898
> 更多详细内容可查看:[RFC: Lazy make for reexports in side effects free barrel file](https://github.com/web-infra-dev/rspack/discussions/11273)
899+
900+
## experiments.deferImport
901+
902+
<ApiMeta addedVersion="1.6.0" />
903+
904+
- **类型:** `boolean`
905+
- **默认值:** `false`
906+
907+
开启后 Rspack 会支持打包 [Deferred Imports Evaluation](https://github.com/tc39/proposal-defer-import-eval) 提案,该功能允许延迟模块的执行直到首次使用。目前仅支持 `import defer * as ns from "./module"`,`import.defer()` 会在后续版本支持。

0 commit comments

Comments
 (0)