0.0.1 • Published 8 years ago
babel-preset-yw v0.0.1
babel-preset-yw
A Babel preset that extends
ES2015
preset and adds features likeasync
/await
,JSX
andFlow types
. Optimal reconfigured babel settings. Includes optional compatibility presets for targeting different environment.
Usage instructions
Installation
Install via NPM:
$ npm install -D babel-preset-yw
Basic Usage
Via .babelrc
(Recommended)
Create a .babelrc
file in your project root, and include 'yw' in your "presets" path:
.babelrc
{
"presets": ["yw"]
}
Via CLI
$ babel script.js --presets yw
Via Node API
If you don't want to use a project-wide .babelrc
file (as above):
require('babel-core').transform('code', {
presets: ['yw']
});
Webpack, Gulp, Browserify, etc
Follow vendor instructions and include yw
in your babel "presets" list.
Advanced Usage
require('babel-core').transform('code', {
presets: [
require('babel-preset-yw/configure')({
flow: true,
jsx: false,
version: true,
regex: true,
symbol: true,
es3: true,
async: true,
strict: false,
compatibility: true,
common: false
}
]
});
0.0.1
8 years ago