I have a side project with Vue.js 3
and vite
as my bundler.
After each build the bundled files got the same hash from the build before, like:
index.432c7f2f.js <-- the hash will be identical after each new build
index.877e2b8d.css
vendor.67f46a28.js
so after each new build (with the same hash on the files) I had to reload the browser hard to clear the cache and see the changes I made.
I tried forcing a clearing with a different version number in the package.json
, but:
- It does not work in the Vite/Rollup environment,
- it doesn't make sense to enter a new number by hand every time after a change.
Question:
Is there any way to configure vite to randomly create new hashes after a new build, or do you know another trick to clear the cache?