Skip to content

mathiasbynens/gulp-regexpu

master
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
 
 
 
 
 
 
 
 
 
 
 
 

gulp-regexpu Build status Dependency status

gulp-regexpu is a Gulp plugin to transpile ES6 Unicode regular expressions to ES5 with regexpu.

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

Note: You may want to use a full-blown transpiler such as gulp-traceur or gulp-babel instead, as those support regexpu transpilation as well as many other ES6/ES7 features.

Install

$ npm install gulp-regexpu --save-dev

Usage

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

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

Source Maps

Use gulp-sourcemaps like this:

var gulp = require('gulp');
var concat = require('gulp-concat');
var regexpu = require('gulp-regexpu');
var sourcemaps = require('gulp-sourcemaps');

gulp.task('default', function() {
  return gulp.src('src/**/*.js')
    .pipe(sourcemaps.init())
      .pipe(regexpu())
      .pipe(concat('all.js'))
    .pipe(sourcemaps.write())
    .pipe(gulp.dest('dist'));
});

Notes

Thanks to Sindre Sorhus, whose many great examples of Gulp plugins made it very easy to create this one. 🍺

Author

twitter/mathias
Mathias Bynens

License

gulp-regexpu is available under the MIT license.

About

Gulp plugin to transpile ES6 Unicode regular expressions to ES5 with regexpu.

Resources

Stars

Watchers

Forks

Packages

No packages published