jamesknelson / gulp-rev-replace

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

should gulp-rev-replace rehash a file? #38

Open orlando opened 9 years ago

orlando commented 9 years ago

I'm running gulp-rev-all and then gulp-rev-replace, gulp-rev-replace changes the already revved files, but keeps the same hash (I don't know if that's the correct behaviour).

Should gulp-rev-replace rehash the file?, if that's expected, is there anything I can do to get it working?

Thanks!

mlarcher commented 9 years ago

It seems to me that the current recipe to "use gulp-rev-replace without gulp-useref" is indeed problematic, as it hashes the file before modifying its contents. If only a referenced file changed (e.g. an image or a font in a css file), the file will keep its hash even though its content changed. @orlando's suggestion is interesting. As rev-replace changes the content, it should also update the hash in the rev-manifest to reflect that change if need be. What do you think?