uniapp开发H5页面时,yarn build警告:asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
执行打包命令时 yarn build,提示:
asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.

虽然影响不大,但这是提示有文件大小超过了限制,会导致占用额外的存储,
处理方法:
1.关闭警告:
打开vue.config.js文件,在 configureWebpack 配置模块中,新加代码如下:
configureWebpack: { .... performance: { hints:false }, .... }
2.设置出现警告的限定值,可以尽量往大设置:
configureWebpack: { .... //警告 webpack 的性能提示 performance: { hints:'warning', //入口起点的最大体积 maxEntrypointSize: 50000000, //生成文件的最大体积 maxAssetSize: 30000000, //只给出 js 文件的性能提示 assetFilter: function(assetFilename) { return assetFilename.endsWith('.js'); } }, .... }
如图:


浙公网安备 33010602011771号