babel的大概知识点 。
-
babel常用的转译器是babel-preset-env。
-
常用的配置选项是plugins和presets
-
常用的使用场景是在webpack中
https://www.cnblogs.com/lsgxeva/p/7758184.html
补充:
个别配置意义
targets
string | Array<string> | { [string]: string }
, defaults to {}
.
Describes the environments you support/target for your project.
This can either be a browserslist-compatible query:
modules
"amd" | "umd" | "systemjs" | "commonjs" | "cjs" | "auto" | false
, defaults to "auto"
.
Enable transformation of ES6 module syntax to another module type.
Setting this to false
will not transform modules.
Also note that cjs
is just an alias for commonjs
.