当前位置: 代码迷 >> 综合 >> asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
  详细解决方案

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

热度:86   发布时间:2023-12-15 04:26:45.0

打包报错:

asset size limit: The following asset(s) exceed the recommended size limit (244 KiB). This can impact web performance.

原因:

webpack打包提示文件体积过大导致的。

解决办法:

在vue.config.js增加配置:

    configureWebpack: config => {// 为生产环境修改配置...if (process.env.NODE_ENV === 'production') {config.mode = 'production';// 打包文件大小配置config.performance = {maxEntrypointSize: 10000000,maxAssetSize: 30000000}}},

完美~~

  相关解决方案