Article Image
read
While looking for a simple but yet effective way to handle my static file versions, I found the awesome grunt-hashres Grunt plugin. Its job is to give each static file a unique version and also update references to the file with current version. awesome.
Installing the plugin:
Configurations are easy. Just add the files you want to update and the files containing the references to them:
This is how my "stage" folder looks like:
While the references to those static files automatically updated to be:
That's it. Quick and simple. For a complete flow example, you can refer to my Angular-realworld demo.