gd
gulp-dereserve
npm i gulp-dereserve
gd

gulp-dereserve

gulp plugin to replace ES3 reserved keyword indentifiers

by Teppei Sato

0.2.1 (see all)License:MITTypeScript:Not Found
npm i gulp-dereserve
Readme

gulp-dereserve NPM version build status Dependency Status

gulp plugin to replace ES3 reserved keyword indentifiers

IE8 cannot parse ES3 reserved keyword like catch. This plugin converts foo.catch() to foo["catch"]() using es3-safe-recast.

Install

$ npm install --save-dev gulp-dereserve

Usage

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

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

Source map

This plugin supports for generating and merging source map. Use gulp-sourcemaps.

$ npm install --save-dev gulp-sourcemaps
var gulp = require('gulp');
var dereserve = require('gulp-dereserve');
var sourcemaps = require('gulp-sourcemaps');

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

API

dereserve(options)

options

No options.

License

MIT License teppeis

No alternatives found
No tutorials found
Add a tutorial
No dependencies found

Rate & Review

100
No reviews found
Be the first to rate