Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

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

readme.md

gulp-regex-rename

Gulp-regex-rename is a gulp plugin for renaming files by matching a regular expression.

Usage

Gulp-regex-rename requires two parameters:

Note that the replacement string can be an empty string.

var babel  = require('gulp-babel')
var gulp   = require('gulp')
var rename = require('gulp-regex-rename')

// Example 1
gulp.task('scripts', function() {
  gulp.src('js/**/*.es6.js')
    .pipe(babel())
    .pipe(rename(/\.es6\.js$/, '.js'))
    .pipe(gulp.dest('dist'))
})

// Example 2
gulp.task('scripts', function() {
  gulp.src('js/**/*.es6.js')
    .pipe(babel())
    .pipe(rename(/\.es6/, ''))
    .pipe(gulp.dest('dist'))
})

Both examples produce equivalent results. Example 1 uses a typical replacement string, while Example 2 uses an empty string, deleting the matched regex.

License

MIT. See license.

About

No description, website, or topics provided.

Resources

License

Releases

No releases published

Packages

No packages published
You can’t perform that action at this time.