gulp-rev-rep
Replace the asset parts of html with revisioned filename. You can find some example code here.
Install
$ npm install --save gulp-rev-rep
Usage
var rep = ;var rev = ; // group the asset filesvar config = {}; config'csses' = libs: 'libfile1.css' 'libfile2.css' 'libfile3.css' user: 'assets/user/*.css' ; config'jses' = libs: 'libfile1.js' 'libfile2.js' 'libfile3.js' user: 'assets/user/*.js' // css & js tasksgulp;gulp;gulp; /*asset_manifest.json file contents: { libs: [ 'libfile1.min-eedf9ee80c.css', 'libfile2.min-jokf9ee80c.css', 'libfile3.min-eedoefe80c.css', 'libfile1.min-5b860c722c.js', 'libfile2.min-5b8oke722c.js', 'libfile3.min-5b8lkj722c.js' ], user: [ 'user1-07422103d7.css', 'user1-fdfsdkflj.js' ] }*/ // replacement taskgulp; gulp;
Result
from html/index.html:
<!-- libs assets --><% bundleName:libs %> <!-- user page assets --><% bundleName : user %>
to public/index.html:
<!-- libs assets --> <!-- user page assets -->
API
options.manifestPath
Type: String
Required: Yes
Path to the asset_manifest.json file generated by https://www.npmjs.com/package/gulp-asset-manifest;
options.jsPath
Type: String
Required: Yes
Base path of site's js path.
options.cssPath
Type: String
Required: Yes
Base path of site's css path.