replace co with bluebird-co(high performace co) 、 replace Promise with bluebird plugin.
This plugin is aiming to transform base Promise、async/await、co
to high performace Bluebird、Bluebird.coroutine、bluebird-co
.So the suggest usage is use this plugin along with transform-async-to-module-method
;
npm install bluebird bluebird-co --save
npm install babel-plugin-transform-bluebird-co transform-async-to-module-method --save-dev
.babelrc
{
"plugins": [
"transform-bluebird-co",
[
"transform-async-to-module-method",
{
"module": "bluebird-co",
"method": "coroutine"
}]
]
}
Requirement global
- NodeJS v5.11.0
- Npm v3.8.6
git clone https://github.com/libotony/babel-plugin-transform-bluebird-co
cd babel-plugin-transform-bluebird-co
npm install
npm test
babel-plugin-transform-bluebird
MIT