npm run build: WARNING in asset size limit: The following asset(s) exceed the recommended size limit
vue项目 npm run build 时,有时回报如下错误: 错误原因,资源(asset)和入口起点超过指定文件限制,需要在 vue.config.js 文件内做如下配置:module.exports = {//webpack配置configureWebpack: {//关闭 webpack 的性能提示performance: {...
·
vue项目 npm run build 时,有时回报如下错误:
错误原因,资源(asset)和入口起点超过指定文件限制,需要在 vue.config.js 文件内做如下配置:
module.exports = {
//webpack配置
configureWebpack: {
//关闭 webpack 的性能提示
performance: {
hints:false
}
//或者
//警告 webpack 的性能提示
performance: {
hints:'warning',
//入口起点的最大体积
maxEntrypointSize: 50000000,
//生成文件的最大体积
maxAssetSize: 30000000,
//只给出 js 文件的性能提示
assetFilter: function(assetFilename) {
return assetFilename.endsWith('.js');
}
}
}
}
详细配置可见 webpack 官网:https://www.webpackjs.com/configuration/performance/
更多推荐
已为社区贡献6条内容
所有评论(0)