babel-preset-modern-async v1.0.0-alpha.3
babel-preset-modern-async
Semi-opinionated preset for Babel based on babel-preset-latest but
using fast-async for async/await transpilation instead of
generators. Also includes configuration options for using Bluebird as the
Promise library, targeting Electron, and setting a stage ( ie. stage-0 )
Install
npm i babel-preset-modern-async
Usage
Minimum configuration:
{
"presets": ["modern-async"]
}You can also pass in a configuration object ( configuration intensifies ):
{
"presets": [["modern-async", {
"fast-async": {
"env": {
"augmentObject": false,
"dontMapStackTraces": true,
"dontInstallRequireHook": true
},
"compiler": {
"promises": true,
"generators": false
},
"runtimePattern": "directive",
"useRuntimeModule": false
},
"electron": false,
"promise": "bluebird",
"stage": 0
}]]
}The above are the default options, the bulk of which come from
fast-async. The rest:
electronWhen set to true, many plugins will be excluded that the Electron environment natively supports. Similar to the
babel-preset-electronpreset.promiseDetermines the Promise implementation, which is left native (or whatever you use at runtime) when this option is anything but
'bluebird'(currently the only option with any affect). When set to'bluebird', thebluebirdlibrary is automatically inserted and all Promise references use it without further configuration.NOTE: The
bluebirdlibrary is not a dependency of this preset. If you intend to use this option, you must install it yourself.stageA number representing the ES feature stage to use in addition to the
latestpreset. These correspond to the Babel-stage-*presets.
More advanced configuration notes are in progress.
License
MIT © Bo Lingen / citycide
See LICENSE