目前鲁班标配为 Babel 7+ 版本react
官网地址 https://babeljs.io/docs/en/pl...git
开发手册 https://github.com/jamiebuild...github
原始代码 --> [Babel Plugin] --> 转换后的代码typescript
能够简单的把Babel Preset视为Babel Plugin的集合babel
{ "presets": [ "env", "@babel/preset-env" // 相等 ] }
{ "presets": [ "a", "b", "c" ] }
运行顺序为从后向前,如:c
, b
,a
async
{ "presets": [ ["@babel/preset-env", { "loose": true, "modules": false }] ] }
{ "plugins": [ "a", "b", "c" ] }
plugins 在 presets 以前运行,运行顺序为从前向后:a
, b
,c
ui
{ "plugins": ["pluginA", ["pluginA"], ["pluginA", {}]] }
{ "plugins": [ [ "transform-async-to-module-method", { "module": "bluebird", "method": "coroutine" } ] ] }