node到v7后支持了async/await,
不想再让项目代码被babel编译的面目全非,
只想编译node还不支持的es6 modules(import export),
请问babel支持的是哪个插件,
或者可以如何设置让babel只编译这部分?
装了
"babel-cli": "^6.18.0",
"babel-plugin-transform-es2015-modules-commonjs": "^6.18.0"
.babelrc
{
"plugins": [
"transform-es2015-modules-commonjs"
]
}
但是--out-file
后还是不能支持es6 modules
还有另一个问题就是node v7目前还是不支持 async/await
Haha, just happened to see this article: https://segmentfault.com/a/11...
Global installation
babel-cli
, *inux, etc. remember to sudoInstall the
babel-plugin-transform-es2015-modules-commonjs
plug-in in the project root directoryWrite the
.babelrc
configuration file in the project root directory, with the content as follows.Test it.
You can check out this https://github.com/babel/babe...