npm run build:h5 報錯


1.報錯信息

(1)asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).

(2)entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.

(3)webpack performance recommendations:

2.解決方案

方式一  webpack中添加如下配置

performance: {
  hints:false
}

方式二 webpack中添加如下配置

performance: {
  hints: "warning", // 枚舉
  maxAssetSize: 30000000, // 整數類型(以字節為單位)
  maxEntrypointSize: 50000000, // 整數類型(以字節為單位)
  assetFilter: function(assetFilename) {
  // 提供資源文件名的斷言函數
  return assetFilename.endsWith('.css') || assetFilename.endsWith('.js');
  
  }
},

.


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM