jamesknelson / gulp-rev-replace

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

gulp-rev-replace not replacing .min.js file reference in html file #55

Closed asimnzr closed 8 years ago

asimnzr commented 8 years ago

Hi,

I am working on updating minified file references in html files but the replacement part is not working - although min file and manifest file generation is working fine along with html page copy to output directory.

I am working with gulp-rev-replace without gulp-useref and using the same code provided in ReadMe:

`var rev = require("gulp-rev"); var revReplace = require("gulp-rev-replace"); gulp.task("revision", ["dist:css", "dist:js"], function(){ return gulp.src(["dist/*/.css", "dist/*/.js"]) .pipe(rev()) .pipe(gulp.dest(opt.distFolder)) .pipe(rev.manifest()) .pipe(gulp.dest(opt.distFolder)) })

gulp.task("revreplace", ["revision"], function(){ var manifest = gulp.src("./" + opt.distFolder + "/rev-manifest.json");

return gulp.src(opt.srcFolder + "/index.html") .pipe(revReplace({manifest: manifest})) .pipe(gulp.dest(opt.distFolder)); });`

Here is the snapshot showing the output of the process where min file name is not replaced in the html page: rev-replace issue

Any help?

mshick commented 8 years ago

@asimnzr I have exactly the same problem. If this is an obvious user error a note would be helpful.