jamesknelson / gulp-rev-replace

Rewrite occurences of filenames which have been renamed by gulp-rev
MIT License
389 stars 62 forks source link

Read JSON manifest files #20

Closed wilsonjackson closed 9 years ago

wilsonjackson commented 9 years ago

This pr adds a manifest option that allows a user to specify JSON manifest files produced by rev. Usage example:

gulp.src('index.html')
  .pipe(revReplace({manifest: gulp.src('rev-manifest.json')}))
  .pipe(gulp.dest('build'));

The rationale for the addition is that in larger projects it's common to process files in separate tasks, or even incrementally. In such cases there are no .revOrig* properties for gulp-rev-replace to read in the stream, but there are manifest files that contain that same information.

Includes a test and readme update. Let me know if there's anything stylistically you don't like.

jamesknelson commented 9 years ago

I've just had a look over this (sorry about being half a year late to the party). It does look like a feature that would be useful to have, although it would require manual merging after some other recent changes.

If you could update the pull request to fit with the latest version, I'll merge it.

optikfluffel commented 9 years ago

+1