yeoman/grunt-filerev — pull request #45 by murphybob (2014-09-10 10:49:38+00:00)
Title: Add support and test for output filename template.

I found that grunt-filerev seemed to be the best plugin to add a hash to my production files, but I found the naming scheme too restrictive. We already used a filename-hash.js format, and other components in the pipeline rely on that which would be significant effort to update.

To that end, I've added support for using a mustache template to generate the output filename. Original filename, hash and original extension are made available to the template - though I can imagine other useful information that could be made available in future (e.g. current date or time).

One curio - the unit tests don't pass on my local build for 2 reasons:
1. They are never run, no tasks following filerev seem to get run. It seems @dannymarsland had a similar issue in his fork and fixed it with this commit https://github.com/dannymarsland/grunt-filerev/commit/bc5ccfa751f78218292ee0909b497f8c8c15cd85
2. The file hashes are different on my machine to those listed in the tests, e.g. where the test expects a0539763 I get d01d8f48. I can only assume this is some odd system dependency (I'm on win32 here). I've used the original expected hashes in my test which should work. Just thought I'd point this one out.