Skip to content

Commit f6fdcd1

Browse files
anshumanvchenxsan
andauthored
docs(configuration): add docs for asyncChunks (webpack#5680)
* feat: add docs for asyncChunks * chore: suggestion Co-authored-by: Sam Chen <[email protected]> Co-authored-by: Sam Chen <[email protected]>
1 parent 3d0badd commit f6fdcd1

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

src/content/configuration/entry-context.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ module.exports = {
7979
filename: 'pages/personal.js',
8080
dependOn: 'shared',
8181
chunkLoading: 'jsonp',
82+
asyncChunks: true, // Create async chunks that are loaded on demand.
8283
layer: 'name of layer', // set the layer for an entry point
8384
},
8485
},

src/content/configuration/output.mdx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,24 @@ The top-level `output` key contains a set of options instructing webpack on how
3737

3838
The same as [`output.filename`](#outputfilename) but for [Asset Modules](/guides/asset-modules/).
3939

40+
## output.asyncChunks
41+
42+
`boolean = true`
43+
44+
Create async chunks that are loaded on demand.
45+
46+
**webpack.config.js**
47+
48+
```javascript
49+
module.exports = {
50+
//...
51+
output: {
52+
//...
53+
asyncChunks: true,
54+
},
55+
};
56+
```
57+
4058
## output.auxiliaryComment
4159

4260
W> Prefer to use [`output.library.auxiliaryComment`](#outputlibraryauxiliarycomment) instead.

0 commit comments

Comments
 (0)