In my js files I have references to HTML files, like window.location. I would like grunt cache bust to update that reference and add the hash data, so the loaded page is the
I worked on a project which used Grunt cache bust to bust filenames in JS files. The configuration looked like this
cacheBust : {
revProd: {
options: {
assets: ['**/*.js', '!assets/js/config.constant.js','**/*.css','!assets/css/themes/*.css'],
baseDir: 'standardversion',
deleteOriginals: true,
jsonOutput: true, // Output the original => new URLs to a JSON file
jsonOutputFilename: 'grunt-cache-bust.json'
},
src: ['standardversion/index.html', 'standardversion/assets/js/config.contants.js']
}
Where my config.contants.js
file has paths like
'propertiesCtrl': 'assets/views/properties/controllers/properties.controller.js',
'propertyDetailsCtrl': 'assets/views/properties/controllers/propertyDetails.controller.js',
'propertyAddCtrl': 'assets/views/properties/controllers/addProperty.controller.js',
You can bust HTMLs by adding **/*.html
to assets
option