Optimize WASM handling and integrate service worker caching.

Removed unused pointer events in BevyScene, updated Vite config with Workbox for service worker caching, and adjusted file paths in generate-bevy-bundle.js. Added WASM size optimization to ensure smaller and efficient builds, skipping optimization for files below 30MB.
This commit is contained in:
geoffsee
2025-07-02 20:25:58 -04:00
committed by Geoff Seemueller
parent 6cc5e038a7
commit fa5b7466bc
4 changed files with 33 additions and 4 deletions

View File

@@ -114,6 +114,14 @@ export default defineConfig(({ command }) => {
})
*/
],
workbox: {
globPatterns: ['**/*.{js,css,html,ico,png,svg,wasm}'],
navigateFallbackDenylist: [/^\/api\//],
maximumFileSizeToCacheInBytes: 25000000,
cacheId: buildId,
cleanupOutdatedCaches: true,
clientsClaim: true,
},
server: {
port: 3000,
proxy: {