Skip to content
This repository has been archived by the owner on Jan 23, 2021. It is now read-only.

sindresorhus/gulp-regenerator

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Deprecated

Use Babel instead.


gulp-regenerator Build Status

Transpile ES2015 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

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

gulp.task('default', () => {
	gulp.src('src/app.js')
		.pipe(regenerator())
		.pipe(gulp.dest('dist'))
);

API

regenerator([options])

options

Type: Object

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:

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

gulp.task('default', () =>
	gulp.src('src/app.js')
		.pipe(sourcemaps.init())
		.pipe(regenerator())
		.pipe(sourcemaps.write('.'))
		.pipe(gulp.dest('dist'))
);

License

MIT © Sindre Sorhus