fix(frontend): remove PWA service worker to stop demo reloads

Drop vite-plugin-pwa and add an index.html snippet that unregisters any leftover service worker and clears its caches on load. Continuous deploys during the event plus a self-destroying SW were forcing open tabs to reload mid-demo. Browsers self-heal on next load; re-add a precaching PWA post-event.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Kartikeya
2026-06-27 23:15:51 -07:00
parent 1c491866ba
commit e0757088ef
2 changed files with 26 additions and 9 deletions
+5 -9
View File
@@ -1,18 +1,14 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import tailwindcss from '@tailwindcss/vite';
import { VitePWA } from 'vite-plugin-pwa';
import { fileURLToPath, URL } from 'node:url';
export default defineConfig({
plugins: [
react(),
tailwindcss(),
// Self-destroying during active development: unregisters any previously
// installed service worker and clears its caches so deploys are always
// fresh (no stale UI). Re-enable a precaching PWA before the demo.
VitePWA({ selfDestroying: true }),
],
// No service worker in production. We deploy continuously during the event and
// any SW (even vite-plugin-pwa's self-destroying one) forces open tabs to
// reload, which breaks the live demo. Existing SWs are torn down by the
// cleanup snippet in index.html. Re-add a precaching PWA only post-event.
plugins: [react(), tailwindcss()],
server: {
port: 5173,
},