Skip to content

Add name/names requirement for async commons chunk #1345

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions content/plugins/commons-chunk-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,16 +138,19 @@ Similar to the above one, but instead of moving common modules into the parent (

```javascript
new webpack.optimize.CommonsChunkPlugin({
// names: ["app", "subPageA"]
// (choose the chunks, or omit for all chunks)
name: "app",
// or
names: ["app", "subPageA"]
// the name or list of names must match the name or names
// of the entry points that create the async chunks

children: true,
// (use all children of the chunk)

async: true,
// (create an async commons chunk)

// minChunks: 3,
minChunks: 3,
// (3 children must share the module before it's separated)
})
```
Expand Down