jonkemp / gulp-useref

Parse build blocks in HTML files to replace references to non-optimized scripts or stylesheets.
MIT License
705 stars 93 forks source link

Breaks image/binary files #187

Open mix3d opened 8 years ago

mix3d commented 8 years ago

I'm not sure if this is bug-worthy or not, but it took me forever to find out why all my image files were getting borked; it turns out it was useref.

Because I am also using gulp-rev-all to version files after useref generates them, I needed all the files for the entire web-app in the same filestream. Following the examples, I blindly piped everything through useref.

At a minumum the docs could be updated to mention this, and maybe add an example of lots of files and using gulp-if or gulp-filter to get just the html files for the useref pipe?

Regardless, useref shouldn't be editing a file if it doesn't find the correct keys, right? Is there a way to discern that it is a binary, not a text file, and ignore it? (Still new to node.js and gulp)

jonkemp commented 8 years ago

I don't see this as a huge problem that needs solving. This is the first time I've ever had this complaint. I do think additional docs could help though, like a recipe section or an examples section.