From 5ffe60492cb41593521aae4e447a0e03c38a80ed Mon Sep 17 00:00:00 2001 From: Nitin Kumar Date: Sun, 15 May 2022 15:29:00 +0530 Subject: [PATCH] docs(configuration): add parser options for dynamic import --- src/content/configuration/module.mdx | 57 ++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/src/content/configuration/module.mdx b/src/content/configuration/module.mdx index 9f60f5167dee..383d58c83c94 100644 --- a/src/content/configuration/module.mdx +++ b/src/content/configuration/module.mdx @@ -165,6 +165,63 @@ Note that only `webpackIgnore` comment is supported at the moment: const x = require(/* webpackIgnore: true */ 'x'); ``` +#### module.parser.javascript.dynamicImportMode + +Specifies global mode for dynamic import. + +- Type: `'eager' | 'weak' | 'lazy' | 'lazy-once'` +- Available: 5.73.0+ +- Example: + ```js + module.exports = { + module: { + parser: { + javascript: { + dynamicImportMode: 'lazy', + }, + }, + }, + }; + ``` + +#### module.parser.javascript.dynamicImportPrefetch + +Specifies global prefetch for dynamic import. + +- Type: ` number | boolean` +- Available: 5.73.0+ +- Example: + ```js + module.exports = { + module: { + parser: { + javascript: { + dynamicImportPrefetch: false, + }, + }, + }, + }; + ``` + +#### module.parser.javascript.dynamicImportPreload + +Specifies global preload for dynamic import. + +- Type: ` number | boolean` +- Available: 5.73.0+ +- Example: + ```js + module.exports = { + module: { + parser: { + javascript: { + dynamicImportPreload: false, + }, + }, + }, + }; + ``` + #### module.parser.javascript.exportsPresence Specifies the behavior of invalid export names in `\"import ... from ...\"` and `\"export ... from ...\"`.