Created
June 13, 2018 08:02
-
-
Save kajstrom/0791c715360451c7195eee6b0464d860 to your computer and use it in GitHub Desktop.
Webpack 3 to Webpack 4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
entry: { | |
pageA: "path/to/pageA_entry.js", | |
pageB: "path/to/pageB_entry.js", | |
vendor: "path/to/vendor_entry.js", | |
}, | |
//.. other configuration not relevant here | |
plugins: [ | |
new CommonsChunkPlugin({ | |
name: "shared", | |
filename: "shared.js", | |
minChunks: 3 | |
}) | |
] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
entry: { | |
pageA: "path/to/pageA_entry.js", | |
pageB: "path/to/pageB_entry.js", | |
vendor: "path/to/vendor_entry.js", | |
}, | |
//.. other configuration not relevant here | |
optimization: { | |
splitChunks: { | |
cacheGroups: { | |
commons: { | |
name: "commons", | |
chunks: "initial", | |
minChunks: 3 | |
}, | |
vendor: { | |
name: "vendor", | |
test: "vendor", | |
priority: 10, | |
enforce: true | |
} | |
} | |
}, | |
runtimeChunk: "single" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment