Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Transpile ES6 generator functions to ES5
branch: master
Failed to load latest commit information.
.editorconfig tweaks
.gitattributes init
.gitignore init
.jshintrc tweaks
.travis.yml Update .travis.yml
fixture.js init
index.js Add support for sourcemaps
license tweaks
package.json 3.1.0
readme.md readme - add Source Maps info
test.js Add support for sourcemaps

readme.md

gulp-regenerator Build Status

Transpile ES6 generator functions to ES5 with Regenerator

Issues with the output should be reported on the Regenerator issue tracker.

Install

$ npm install --save-dev gulp-regenerator

Usage

var gulp = require('gulp');
var regenerator = require('gulp-regenerator');

gulp.task('default', function () {
    return gulp.src('src/app.js')
        .pipe(regenerator())
        .pipe(gulp.dest('dist'));
});

API

regenerator(options)

options.includeRuntime

Type: boolean
Default: false

A small runtime library (less than 1KB compressed) is required to provide the wrapGenerator function. You can install it either as a CommonJS module or as a standalone .js file, whichever you prefer.

Source Maps

Use gulp-sourcemaps like this:

var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var regenerator = require('gulp-regenerator');

gulp.task('default', function () {
    return gulp.src('src/app.js')
        .pipe(sourcemaps.init())
        .pipe(regenerator())
        .pipe(sourcemaps.write('.'))
        .pipe(gulp.dest('dist'));
});

License

MIT © Sindre Sorhus

Something went wrong with that request. Please try again.