記一次vue項目打包時提示Entrypoint size limit 的警告


直接拋出問題: 

vue-cli打包項目時警告: entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.

 

 解決辦法:

  直接在vue.config.js文件中配置: 



 

 performance: {
      hints: 'warning',
      // 入口起點的最大體積
      maxEntrypointSize: 50000000,
      // 生成文件的最大體積
      maxAssetSize: 30000000,
      // 只給出 js 文件的性能提示
      assetFilter: function (assetFilename) {
        return assetFilename.endsWith('.js')
      }
    }

 


免責聲明!

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



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