0.0.1 • Published 9 years ago
babel-preset-yw v0.0.1
babel-preset-yw
A Babel preset that extends
ES2015preset and adds features likeasync/await,JSXandFlow types. Optimal reconfigured babel settings. Includes optional compatibility presets for targeting different environment.
Usage instructions
Installation
Install via NPM:
$ npm install -D babel-preset-ywBasic 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 ywVia 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
9 years ago