I would like to move all common chunks of my bundles to a vendor.[chunkhash].js
file. However after inspecting the output I see some node_modules
are included more then once having a large impact on output size.
Webpack commonsChunkPlugin
new webpack.optimize.CommonsChunkPlugin({
name: "vendor",
filename: "vendor.[chunkhash].js",
minChunks(module, count) {
const context = module.context;
return context && context.indexOf("node_modules") >= 0;
}
}),
Am I doing this wrong? Be aware that the ´wizer-components´ are components which also need to be built but have been put in a separate folder because I use them throughout other projects. Running the dev server is working fine and all components are working.