diff --git a/website/docs/en/api/modules/module-methods.mdx b/website/docs/en/api/modules/module-methods.mdx index 76a2f680e74..e94098c7989 100644 --- a/website/docs/en/api/modules/module-methods.mdx +++ b/website/docs/en/api/modules/module-methods.mdx @@ -109,6 +109,7 @@ import( /* webpackPreload: true */ /* webpackMode: "lazy" */ /* webpackIgnore: true */ + /* webpackFetchPriority: "high" */ 'module' ); ``` @@ -162,6 +163,14 @@ Tells the browser that the resource might be needed during the current navigatio A name for the new chunk. +##### webpackFetchPriority + + + +- **Type:**: `"low" | "high" | "auto"` + +Set [`fetchPriority`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/fetchPriority) for specific dynamic imports. It's also possible to set a global default value for all dynamic imports by using the `module.parser.javascript.dynamicImportFetchPriority` option. + ## CommonJS Rspack is also support `CommonJS` syntax natively, you can use `require` and `module.exports` methods. diff --git a/website/docs/zh/api/modules/module-methods.mdx b/website/docs/zh/api/modules/module-methods.mdx index fd3ff85ffb8..db742a12245 100644 --- a/website/docs/zh/api/modules/module-methods.mdx +++ b/website/docs/zh/api/modules/module-methods.mdx @@ -107,6 +107,7 @@ import( /* webpackPreload: true */ /* webpackMode: "lazy" */ /* webpackIgnore: true */ + /* webpackFetchPriority: "high" */ 'module' ); ``` @@ -160,6 +161,14 @@ import( 指定新 chunk 的名称。 +##### webpackFetchPriority + + + +- **类型:**: `"low" | "high" | "auto"` + +为指定的动态导入设置 [`fetchPriority`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/fetchPriority)。也可以通过使用 `module.parser.javascript.dynamicImportFetchPriority` 选项为所有动态导入设置全局默认值。 + ## CommonJS Rspack 也支持 `CommonJS` 语法,可以使用 `require` 和 `module.exports` 语法。