fix(web): raise workbox precache limit for oversized main chunk

The app's main chunk grew past workbox's 2MiB default precache cap,
which made vite-plugin-pwa fail the production build (and would have
failed the GitHub Pages deploy too). Raise the limit to 4MiB so the
SPA stays fully precached for offline use.

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <noreply@hapi.run>
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-08-05 11:16:08 +08:00
co-authored by HAPI Claude
parent dd1cd24a46
commit d3544d557b
+4 -1
View File
@@ -155,7 +155,10 @@ export default defineConfig({
}
},
injectManifest: {
globPatterns: ['**/*.{js,css,html,ico,png,svg,woff,woff2}']
globPatterns: ['**/*.{js,css,html,ico,png,svg,woff,woff2}'],
// The app's main chunk exceeds workbox's 2MiB default precache
// cap; raising the limit keeps the SPA fully precached offline.
maximumFileSizeToCacheInBytes: 4 * 1024 * 1024,
},
devOptions: {
enabled: true,