admin管理员组文章数量:1420220
Folder Structure:
app.js, benchmark.js, board.js all require jquery. I just want to extract jquery as vender.js and three other bundles only contain application code:
Webpack Config:
The result is not what I expected:
app.js, benchmark.js, board.js still contains jquery code (as you can see from the huge file size)
Is there anything wrong with my webpack configuration? I just followed the example in :
Folder Structure:
app.js, benchmark.js, board.js all require jquery. I just want to extract jquery as vender.js and three other bundles only contain application code:
Webpack Config:
The result is not what I expected:
app.js, benchmark.js, board.js still contains jquery code (as you can see from the huge file size)
Is there anything wrong with my webpack configuration? I just followed the example in : https://github./webpack/webpack/tree/master/examples/two-explicit-vendor-chunks https://github./webpack/webpack/tree/master/examples/multiple-entry-points
Share Improve this question asked Sep 27, 2015 at 21:40 AlanAlan 6446 silver badges19 bronze badges1 Answer
Reset to default 6plugins
should be an object array outside of modules
.
Also, I don't think you need the minChunks or chunks options for this use case scenario. Your vendor entry chunk should be sufficient.
entry: {
vendor: ['jquery']
},
plugins: [
new webpack.optimize.CommonsChunkPlugin({
name: "vendor",
filename:"vendor.js",
minChunks: Infinity
})
];
本文标签: javascriptWebpack CommonsChunkPlugin not working as expectedStack Overflow
版权声明:本文标题:javascript - Webpack CommonsChunkPlugin not working as expected - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745324600a2653531.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论