In the examples "webpack/examples/multiple-commons-chunks/", the current config in webpack.config.js has one spelling mistake, as seen below:
new CommonsChunkPlugin({
name: "admin-commons",
chunks: ["adminPageA", "adminPageB"]
}),
new CommonsChunkPlugin({
name: "commons",
chunks: ["pageA", "pageB", "admin-commons.js"],
minChunks: 2
}),
new CommonsChunkPlugin({
name: "c-commons",
chunks: ["pageC", "adminPageC"]
}),
we should change "admin-commons.js" to "admin-commons" in the second CommonsChunkPlugin option,
if it is "admin-commons.js", the bundle named "admin-commons" will contain two module, "./modules/admin" and "./modules/a-b-c";
but if it is "admin-commons", the bundle named "admin-commons" will just contain one module -- "./modules/admin".
This lead to a entirely different result , which take me about two days to understand the way how webpack bundles commons chunk..So please correct it~~~thanks
In the examples "webpack/examples/multiple-commons-chunks/", the current config in webpack.config.js has one spelling mistake, as seen below:
we should change "admin-commons.js" to "admin-commons" in the second CommonsChunkPlugin option,
if it is "admin-commons.js", the bundle named "admin-commons" will contain two module, "./modules/admin" and "./modules/a-b-c";
but if it is "admin-commons", the bundle named "admin-commons" will just contain one module -- "./modules/admin".
This lead to a entirely different result , which take me about two days to understand the way how webpack bundles commons chunk..So please correct it~~~thanks