Breaking Changes
Please refer to the corresponding installation section:
- vite-plugin-pwa
- @vite-pwa/sveltekit
- @vite-pwa/vitepress
- @vite-pwa/astro
- @vite-pwa/nuxt
- @vite-pwa/assets-generator
Rollup 4 and Vite 5
Rollup 4 has changed the asset name layout format, it is using base64
encoding, previous Rollup versions using hex
encoding:
- Using more characters can make the hash length shorter
- Using a faster hash algorithm can make hashing faster
- This is the PR that changed the hash algorithm: https://github.com/rollup/rollup/pull/5155
This change breaks the way vite-plugin-pwa
build plugin builds the service worker, since it is using this regular expression /[.-][a-f0-9]{8}\./
for dontCacheBustURLsMatching in workbox
and injectManifest
options.
In version v0.17.0
, vite-plugin-pwa
configures dontCacheBustURLsMatching
with a regular expression using the Vite's build.assetsDir option (defaults to assets
):
workbox.dontCacheBustURLsMatching = /^assets\//
injectManifest.dontCacheBustURLsMatching = /^assets\//
You can refer to this issue for more details about dontCacheBustURLsMatching
: Workbox appears to be needlessly generating revision hashes.
@vite-pwa/vitepress
In version v0.3.0
, @vite-pwa/vitepress
configures dontCacheBustURLsMatching
in a similar way to how vite-plugin-pwa
does, but using the VitePress' assetsDir option.
Other integrations
If you're using vite-plugin-pwa
or another integration with other meta frameworks (îles, Astro, SvelteKit, Nuxt 3), review the generated service worker if you're using Vite 5 or Rollup 4, and update the dontCacheBustURLsMatching
regular expression properly.