Home

Awesome

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.