gulp-rebase

Adjust the base directory of a gulp file

Usage no npm install needed!

<script type="module">
  import gulpRebase from 'https://cdn.skypack.dev/gulp-rebase';
</script>

README

gulp-rebase

Rebase gulp file paths

Installation

npm install gulp-rebase

Usage

Beginning of path

  gulp.src('some/path/**/*.js')
  .pipe(rebase('^2'));
  // Would convert /this/path/here => /this/path

End of path

  gulp.src('some/path/**/*.js')
  .pipe(rebase('2

));
  // Would convert /this/path/here/is/long => /this/path/here

Explicit overwrite

  gulp.src('some/path/**/*.js')
  .pipe(rebase('/some/new/path'));
  // Would convert /this/path/here => /some/new/path