-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create one hash per "group" of assets (eg. for Retina/hidpi pairs) #15
Comments
I agree on this one, would love to see a solution for it. |
I'd like to see this feature to. In my case I'm using svgeezy to replace svg image with a png in browsers that don't support svg (IE8, etc). svgeezy works by looking up the svg filename/path and then looking for a file with the same path/name but a png extension. It would be great to be able tos et some sort of group or matching option to give the svg and png versions of a file the same hash. |
I've made a pull-request that implements this feature. https://github.com/TinyCarrier/grunt-rev You can use like this (package.json):
Here is an example usage for the alt-feature:
This produces a
... becomes:
... despite they are different images with different hashes. You can specify |
Moving my comments to the pull request! #21 |
Check #21 which implements this. |
There's a technique in the wild where you can use an in-browser HTML preprocessor to replace instances of "foo.png" with "[email protected]" depending on the client's display resolution. It's pretty awesome. It works like this (just imagine a string replacement on
src
rather than whatever's going on in that example).Of course, asset hashing breaks this. There's no replacement I can perform on
3d15f.foo.png
to end up with[email protected]
.What's your opinion of a feature that would allow you to hash assets as a group? I would love it if grunt-rev would allow me to specify that files matching the pattern
*.png
and*@2x.png
belong to a group of files that should all share the same hash.Thoughts?
The text was updated successfully, but these errors were encountered: