首页 > 解决方案 > 如何解决服务器中的 ERROR [BABEL] 最大大小 500KB 问题?

问题描述

我正在将 NUXTJS 应用程序用于 SSR 页面,但出现 bootstrap-vue 图标大小问题的错误。

该文件托管在 AWS 服务器中,这将是错误

The code generator has deoptimised the styling of 
/var/www/html/my_folder/node_modules/bootstrap-vue/src/icons/icons.js
as it exceeds the max of 500KB.

在此处输入图像描述

这会是什么问题?我也在构建位置添加了巴贝尔..

标签: vue.jsbootstrap-vuenuxtjs

解决方案


尝试添加

babel: { compact: true }

下面extend(config, ctx) {},这样

....
 /*
 ** You can extend webpack config here
 */
 extend(config, ctx) {},
 babel: { compact: true }

参考:https ://github.com/bootstrap-vue/bootstrap-vue/issues/5627#issuecomment-668487772

编辑:在 nuxt.config.js 文件上编辑它


推荐阅读