Skip to content

Commit 60c38ae

Browse files
FadySamirSadekmontogeek
authored andcommitted
feat(api) Document webpackIgnore option (#2101)
Solves #2077
1 parent 77fa76a commit 60c38ae

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/content/api/module-methods.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ sort: 3
55
contributors:
66
- skipjack
77
- sokra
8+
- fadysamirsadek
89
- byzyk
910
related:
1011
- title: CommonJS Wikipedia
@@ -74,14 +75,14 @@ W> This feature relies on [`Promise`](https://developer.mozilla.org/en-US/docs/W
7475
The spec for `import` doesn't allow control over the chunk's name or other properties as "chunks" are only a concept within webpack. Luckily webpack allows some special parameters via comments so as to not break the spec:
7576

7677
``` js
77-
// single target
78+
// Single target
7879
import(
7980
/* webpackChunkName: "my-chunk-name" */
8081
/* webpackMode: "lazy" */
8182
'module'
8283
);
8384

84-
// multiple possible targets
85+
// Multiple possible targets
8586
import(
8687
/* webpackInclude: /\.json$/ */
8788
/* webpackExclude: /\.noimport\.json$/ */
@@ -91,6 +92,14 @@ import(
9192
);
9293
```
9394

95+
```js
96+
import(/* webpackIgnore: true */ 'ignored-module.js');
97+
```
98+
99+
`webpackIgnore`: Disables dynamic import parsing when set to `true`.
100+
101+
W> Note that setting `webpackIgnore` to `true` opts out of code splitting.
102+
94103
`webpackChunkName`: 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.
95104

96105
`webpackMode`: Since webpack 2.6.0, different modes for resolving dynamic imports can be specified. The following options are supported:

0 commit comments

Comments
 (0)