gulp-ref-hash
Generates a hashed name for assets concatenated using the useref build blocks.
Install
Install with npm
npm install --save-dev gulp-ref-hash
Usage
The simple task below will iterate through all the templates, identify any defined useref build blocks with, or without a name, and generate a new unique filename.
var gulp = var useref = ;var refHash = ; gulp;
Running the example above on the example below will yield the following results:
Input
<!-- build:css --> <!-- endbuild --> <!-- build:js --> <!-- endbuild -->
Output
Options
By default css/js asset paths will be set to /static/[type]/...
, however you can change that by passing path options to ref-hash. For example:
var gulp = var useref = ;var refHash = ; gulp;