By default, a release build of an Ionic app uses fixed paths for resources such as JS, CSS, images, e.g:
index.html build/vendor.js build/main.js build/main.css build/polyfills.js ...etc
This is proving problematic with regards to caching when the app is accessed via a conventional browser, because browsers tend to aggressively cache js libraries and styles, and a manual cache purge is required in order for updates to show up. Also, if some CDN caching is used, then the cache should be manually flushed on CDN too.
Is there a way to force automatic file versioning for Ionic, so that on each build unique file names as created?
I.e. how to get Ionic to generate the following instead?
index.html build/vendor.a66f828dca56eeb90e02.js build/main.18b12496ca4a0f639e59.jss build/main.ef8cbc5c544fd62b6df3.css build/polyfills.77d2aa935bdcf01897be.js
I am looking at generating unique hashes on every build or using the last git commit hash or whatever other approaches exist for this.
Angular does this by default without having to do any explicit configurations, but I could not find how to enable this for Ionic.