我只想从普通块中提取供应商,但以下配置不起作用。什么是正确的配置?
entry: {
vendor: ['vue', 'vuex', 'vue-router', 'vuex-router-sync','vue-resource']
}
new webpack.optimize.CommonsChunkPlugin({
name:'common',
minChunks: function (module, count) {
return (
module.resource &&
/\.js$/.test(module.resource) &&
module.resource.indexOf(
path.join(__dirname, '../node_modules')
) === 0
)
}
}),
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
chunks:['vendor','common']
})