http://webpack.github.io/docs/list-of-plugins.html#commonschunkplugin
里的 name 和 filename有什么区别 ?
new CommonsChunkPlugin({
name: "commons",
// (the commons chunk name)
filename: "commons.js",
// (the filename of the commons chunk)
// minChunks: 3,
// (Modules must be shared between 3 entries)
// chunks: ["pageA", "pageB"],
// (Only use these entries)
})
巴扎黑2017-04-10 16:00:50
name 是配置文件里面入口文件的键名,filename 是输出的文件名。
var webpack = require('webpack')
module.exports = {
entry : {
vendor : ['jquery']
}
...
plugins : [
new webpack.optimize.CommonsChunkPlugin('vendor', 'vendor.bundle.js')
]
}