gulp-babel
Use next generation JavaScript, today, with Babel
Issues with the output should be reported on the Babel issue tracker.
Install
$ npm install --save-dev gulp-babel babel-preset-es2015
Usage
const gulp = ;const babel = ; gulp;
API
const createBabel = ; /** * @see https://github.com/isaacs/node-lru-cache#options */type lruOptions = max: ?number length: ?Function dispose: ?Function maxAge: ?number}; /** * @see See the Babel options (https://babeljs.io/docs/usage/options/), except for `sourceMap` and `filename` which is handled for you. */type babelOptions = {}; const babel = ; ;
Source Maps
Use gulp-sourcemaps like this:
const gulp = ;const sourcemaps = ;const createBabel = ;const concat = ; const babel = ; gulp;
Babel Metadata
Files in the stream are annotated with a babel
property, which contains the metadata from babel.transform()
.
Example
const gulp = ;const createBabel = ;const through = ; const babel = ; { return through;} gulp
Runtime
If you're attempting to use features such as generators, you'll need to add transform-runtime
as a plugin, to include the Babel runtime. Otherwise, you'll receive the error: regeneratorRuntime is not defined
.
Install the runtime:
$ npm install --save-dev babel-plugin-transform-runtime
Use it as plugin:
const gulp = ;const createBabel = ; const babel = ; gulp;
License
MIT © Sindre Sorhus