You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Disables dynamic import parsing when set to `true`.
146
147
147
148
When using `import.meta.url`, it does not remain as-is; instead, it gets replaced based on the `baseURI`. For modules, it is replaced with `new URL("./", import.meta.url)`, and for other cases, it defaults to `document.baseURI`. This ensures that relative URLs work correctly, aligning with the base URL context.
148
149
149
150
W> Note that setting `webpackIgnore` to `true` opts out of code splitting.
150
151
151
-
##### `webpackChunkName`
152
+
##### webpackChunkName
152
153
153
154
A name for the new chunk. Since webpack 2.6.0, the placeholders `[index]` and `[request]` are supported within the given string to an incremented number or the actual resolved filename respectively. Adding this comment will cause our separate chunk to be named [my-chunk-name].js instead of [id].js.
154
155
155
-
##### `webpackFetchPriority`
156
+
##### webpackFetchPriority
156
157
157
158
<Badge text="5.87.0+" />
158
159
@@ -165,7 +166,7 @@ import(
165
166
);
166
167
```
167
168
168
-
##### `webpackMode`
169
+
##### webpackMode
169
170
170
171
Since webpack 2.6.0, different modes for resolving dynamic imports can be specified. The following options are supported:
171
172
@@ -174,27 +175,27 @@ Since webpack 2.6.0, different modes for resolving dynamic imports can be specif
174
175
- `'eager'`: Generates no extra chunk. All modules are included in the current chunk and no additional network requests are made. A `Promise` is still returned but is already resolved. In contrast to a static import, the module isn't executed until the call to `import()` is made.
175
176
- `'weak'`: Tries to load the module if the module function has already been loaded in some other way (e.g. another chunk imported it or a script containing the module was loaded). A `Promise` is still returned, but only successfully resolves if the chunks are already on the client. If the module is not available, the `Promise` is rejected. A network request will never be performed. This is useful for universal rendering when required chunks are always manually served in initial requests (embedded within the page), but not in cases where app navigation will trigger an import not initially served.
176
177
177
-
##### `webpackPrefetch`
178
+
##### webpackPrefetch
178
179
179
180
Tells the browser that the resource is probably needed for some navigation in the future. Check out the guide for more information on [how webpackPrefetch works](/guides/code-splitting/#prefetchingpreloading-modules).
180
181
181
-
##### `webpackPreload`
182
+
##### webpackPreload
182
183
183
184
Tells the browser that the resource might be needed during the current navigation. Check out the guide for more information on [how webpackPreload works](/guides/code-splitting/#prefetchingpreloading-modules).
184
185
185
186
T> Note that all options can be combined like so `/* webpackMode: "lazy-once", webpackChunkName: "all-i18n-data" */`. This is wrapped in a JavaScript object and executed using [node VM](https://nodejs.org/dist/latest-v8.x/docs/api/vm.html). You do not need to add curly brackets.
186
187
187
-
##### `webpackInclude`
188
+
##### webpackInclude
188
189
189
190
A regular expression that will be matched against during import resolution. Only modules that match **will be bundled**.
190
191
191
-
##### `webpackExclude`
192
+
##### webpackExclude
192
193
193
194
A regular expression that will be matched against during import resolution. Any module that matches **will not be bundled**.
194
195
195
196
T> Note that `webpackInclude` and `webpackExclude` options do not interfere with the prefix. eg: `./locale`.
196
197
197
-
##### `webpackExports`
198
+
##### webpackExports
198
199
199
200
Tells webpack to only bundle the specified exports of a dynamically `import()`ed module. It can decrease the output size of a chunk. Available since [webpack 5.0.0-beta.18](https://github.com/webpack/webpack/releases/tag/v5.0.0-beta.18).
0 commit comments