From d3544d557bc08db78651c52b8f6e45938cd3d455 Mon Sep 17 00:00:00 2001 From: wusumac <736139669@qq.com> Date: Tue, 4 Aug 2026 14:42:22 +0800 Subject: [PATCH] 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 Co-Authored-By: Claude --- web/vite.config.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/vite.config.ts b/web/vite.config.ts index 647f1559..d1c5cddd 100644 --- a/web/vite.config.ts +++ b/web/vite.config.ts @@ -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,