使用webpack打包出现 it exceeds the max of "500KB" 怎么解决?

 40% building modules 257/263 modules 6 active ...web/src/dashboard/router/404/index.js[BABEL] Note: The code generator has deoptimised the styling of "/Users/lisiqi/Desktop/bty/catfood_web/src/dashboard/slides/abbott-test/map/echarts-gl-2.2.2.js" as it exceeds the max of "500KB".
阅读 28.1k
3 个回答
新手上路,请多包涵

你在当前项目的目录下搜索 .babelrc 文件 ,结果的第一个打开,
加上这行代码 "compact": false ,

clipboard.png

不要打包echarts-gl-2.2.2.js,直接引入啊

{
  "compact": false,
  "ast": false,
  "sourceMaps": "inline",
  "highlightCode": true,
  "presets": ["env", "react", "stage-0"],
  "plugins": [
    "transform-runtime",
    ["transform-es2015-modules-amd", {"strict": false}],
    ["import", { "libraryName": "antd", "style": true }]
  ],
  "ignore": [
    "biz/report/**",
    "dsp-base/**/biz/tool/keywords/**"
  ]
}
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题