ember-cli / broccoli-asset-rev

Broccoli plugin to add fingerprint checksums and CDN URLs to your assets
MIT License
86 stars 83 forks source link

Option to pass a custom hash string #3

Closed chnn closed 10 years ago

chnn commented 10 years ago

If you specify the customHash option, it will be used instead of the MD5 digest for appending to filenames. So passing “my-hash” produces assets/vendor-my-hash.js instead of assets/vendor-4e4d543cde3c8a73d4723711eca0796c.js.

My use case for this is that elsewhere in my app I have a python web server serving up the entry point (index.html) for an ember-cli app, and there's some other stuff in there that prevents me from using the ember-cli generated index.html. I need an easy way in that template to know the names of the fingerprinted files. In the past I've used git commit SHAs as fingerprints (they are helpful in debugging production deploys too) which is what I would do with a custom hash option.

Let me know what you think.

rickharrison commented 10 years ago

Can you show me how you are updating your Brocfile with the custom hash?

chnn commented 10 years ago

I was planning on using something like this this or this or maybe just grabbing the stdout from

git rev-parse HEAD
rickharrison commented 10 years ago

Can you rebase this into one commit please.

chnn commented 10 years ago

Done. I updated the options section in the README too, let me know if it needs tweaking.

chnn commented 10 years ago

Would you mind pushing a new version to npm at some point?

rickharrison commented 10 years ago

done

chnn commented 10 years ago

Awesome, thanks.