解决The code generator has deoptimised the styling of xxxx.js as it exceeds the max of 500kb

2023-11-13

解决The code generator has deoptimised the styling of xxxx.js as it exceeds the max of 500kb

1.需求背景
  • 最近在vue项目引用了一个js文件,由于这个文件的大小超过了500kb,因此在打包的时候抛了一个错:The code generator has deoptimised the styling of xxxx.js as it exceeds the max of 500kb
解决方案
  • 这个问题其实就是babel处理文件的大小被限制在了500kb,解决如下:

  • // 在项目根目录下查找 .babelrc 或 babel.config.js 文件,如果没有就创建一个(两者其一即可),配置如下:
    
    // .babelrc:
    {
      "compact": false
    }
    
    // babel.config.js:
    module.exports = {
        compact: false,
    }
    
    
  • 解决。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

解决The code generator has deoptimised the styling of xxxx.js as it exceeds the max of 500kb 的相关文章

随机推荐