gulp-revert-path 
Revert the previous file.path change
Many plugins change the file.path somehow. Most commonly the file extension. For example gulp-babel changes .jsx extensions to .js since it compiles JSX. Sometimes that's undesirable though. This plugin makes it easy to revert the path change.
Install
$ npm install --save-dev gulp-revert-path
Usage
var gulp = require('gulp');
var babel = require('gulp-babel');
var revertPath = require('gulp-revert-path');
var rename = require('gulp-rename');
gulp.task('default', function () {
return gulp.src('src/app.jsx')
.pipe(babel())
.pipe(revertPath())
.pipe(gulp.dest('dist'));
});
gulp.task('es2015', function () {
return gulp.src('src/app.txt')
.pipe(rename('src/app.jsx'))
.pipe(babel())
.pipe(revertPath(2))
.pipe(gulp.dest('dist'));
});
API
revertPath(reversions)
reversions
Type: number
Default: 1
Number of times to revert the path.
Related
License
MIT © Sindre Sorhus