npm build完以后,出现以下警告:
WARNING Compiled with 2 warnings 17:51:33
warning
asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
中略
warning
entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
中略
在vue.config.js中,追加以下设定:
module.exports = {
configureWebpack: {
performance: {
hints:'warning',
maxEntrypointSize: 50000000,
maxAssetSize: 30000000,
assetFilter: function(assetFilename) {
return assetFilename.endsWith('.js');
}
}
}
}
详细请参考: https://www.webpackjs.com/configuration/performance/