总结下针对不同warning的解决办法
1.
chunk chunk-common [mini-css-extract-plugin]
Conflicting order. 说的是援用css 文件的程序有抵触, 能够减少配置,疏忽这样的warning
在vue.config.js 中减少
configureWebpack: {
plugins: [
new CustomFilterPlugin({
exclude: /Conflicting order. Following module has been added:/ //疏忽含有“Conflicting order. Following module has been added:”文本的正告
}),
}
2.构建了两次版本, 一次是旧版的bundle, 一次是新版的bundle
- Building legacy bundle for production...
(snip)
DONE Compiled successfully in 42448ms
(snip)
- Building modern bundle for production...
(snip)
DONE Compiled successfully in 39693ms
(snip)
DONE Build complete. The dist directory is ready to be deployed.
(snip)
Done in 89.76s.
这是因为build 时带了–modern 参数, 若只反对古代浏览器, 能够去掉, 在package.json 中减少
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
3.
资源(asset)和入口终点超过指定文件限度,须要在 vue.config.js 文件内做如下配置
configureWebpack: {
performance: {
hints: 'warning', // 三个取值 false;敞开性能提醒 warning: error:只提醒报错
maxAssetSize: 5*1024*1024, //资源asset 最大值5M
maxEntrypointSize: 8*1024*1024, // 入口终点最大值8M
}
},
4.终于没有各种warning 了
发表回复