Skip to content

Commit bee26a6

Browse files
authored
docs(configuration): add parser options for dynamic import (#6145)
1 parent 3506584 commit bee26a6

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

src/content/configuration/module.mdx

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,63 @@ Note that only `webpackIgnore` comment is supported at the moment:
165165
const x = require(/* webpackIgnore: true */ 'x');
166166
```
167167

168+
#### module.parser.javascript.dynamicImportMode
169+
170+
Specifies global mode for dynamic import.
171+
172+
- Type: `'eager' | 'weak' | 'lazy' | 'lazy-once'`
173+
- Available: 5.73.0+
174+
- Example:
175+
```js
176+
module.exports = {
177+
module: {
178+
parser: {
179+
javascript: {
180+
dynamicImportMode: 'lazy',
181+
},
182+
},
183+
},
184+
};
185+
```
186+
187+
#### module.parser.javascript.dynamicImportPrefetch
188+
189+
Specifies global prefetch for dynamic import.
190+
191+
- Type: ` number | boolean`
192+
- Available: 5.73.0+
193+
- Example:
194+
```js
195+
module.exports = {
196+
module: {
197+
parser: {
198+
javascript: {
199+
dynamicImportPrefetch: false,
200+
},
201+
},
202+
},
203+
};
204+
```
205+
206+
#### module.parser.javascript.dynamicImportPreload
207+
208+
Specifies global preload for dynamic import.
209+
210+
- Type: ` number | boolean`
211+
- Available: 5.73.0+
212+
- Example:
213+
```js
214+
module.exports = {
215+
module: {
216+
parser: {
217+
javascript: {
218+
dynamicImportPreload: false,
219+
},
220+
},
221+
},
222+
};
223+
```
224+
168225
#### module.parser.javascript.exportsPresence
169226

170227
Specifies the behavior of invalid export names in `\"import ... from ...\"` and `\"export ... from ...\"`.

0 commit comments

Comments
 (0)