问题一:
解决方法:npm install webpack-cli --sava-dev
问题二:
目前,4.0中已经删除CommonsChunkPlugin,替换成了splitChunks
解决方法:
去除 new webpack.optimize.CommonsChunkPlugin,修改为
optimization: {
runtimeChunk: {
name: "manifest"
},
splitChunks: {
cacheGroups: {
commons: {
test: /[\\/]node_modules[\\/]/,
name: "vendor",
chunks: "all"
}
}
}
}