title: “Babel” author: “-” date: “2020-05-16T09:35:43Z” url: “babel” categories:

  • web tags:
  • babel

“Babel”

Babel 是什么?

Babel 是一个 JavaScript 编译器

Babel 是一个工具链,主要用于将 ECMAScript 2015+ 版本的代码转换为向后兼容的 JavaScript 语法,以便能够运行在当前和旧版本的浏览器或其他环境中。下面列出的是 Babel 能为你做的事情:

  • 语法转换
  • 通过 Polyfill 方式在目标环境中添加缺失的特性 (通过 @babel/polyfill 模块)
  • 源码转换 (codemods)

exceeds the max of 500KB

ERROR [BABEL] Note: The code generator has deoptimised the styling of /…/path/to/file/bigger/than/500/k/node_modules/bootstrap-vue/src/icons/icons.js as it exceeds the max of 500KB.

1
2
3
4
5
6
{
     // 编译后的代码省略所有可选的换行符和空格
     "compact": true,
     // 在原始文件中不存在的代码片段之前插入的前缀注释(不推荐使用,仅为了举例)
     "auxiliaryCommentBefore": "before-content"
}

https://zhuanlan.zhihu.com/p/67989826