目前魯班標配爲 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" } ] ] }