Package Exports
- babel-plugin-transform-bluebird
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (babel-plugin-transform-bluebird) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
babel-plugin-transform-bluebird
replace Promise with bluebird plugin.
Installation
npm install bluebird babel-plugin-transform-bluebird --saveExample
In
Promise.resolve().then(() => new Promise((resolve) => resolve()))Out
import _default from "bluebird";
import { resolve as _resolve } from "bluebird";
_resolve().then(() => new _default(resolve => resolve()));Usage
Via .babelrc (Recommended)
.babelrc
{
"plugins": ["transform-bluebird"]
}Via CLI
$ babel --plugins transform-bluebird script.jsVia Node API
require("babel-core").transform("code", {
plugins: ["transform-bluebird"]
});Development
Requirement global
- NodeJS v5.11.0
- Npm v3.8.6
git clone https://github.com/59naga/babel-plugin-transform-bluebird
cd babel-plugin-transform-bluebird
npm install
npm test