new HtmlWebpackPlugin({
filename: 'index.html',
template: 'www/index.html',
inject: true,
chunks:['index','manifest','vendor']
}),
new HtmlWebpackPlugin({
filename: 'login.html',
template: 'www/login.html',
inject: true,
chunks:['main','manifest','vendor']
}),
new HtmlWebpackPlugin({
filename: 'home.html',
template: 'www/home.html',
inject: true,
chunks:['home','manifest','vendor']
}),
像上面这样的代码能怎么优化吗?
这个chunks的配置是不是有问题?能怎么改?
entry: {
main:'./src/main.js',
index: './src/index.js',
home:'./src/home.js'
},
output: {
},
这样做不同页面之间缓存的东西还是会有多余的吧
确实有些大。我认为是element配置上的问题,全部引入了,可以参考这里 引入 Element - 按需引入