mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
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:
+4
-1
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user