You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add vite-plugin-pwa (new dependency — per map #1's decision) to apps/web/vite.config.ts, configure Workbox precaching for static assets, register the service worker in main.tsx.
apps/web/vite.config.ts: added VitePWA plugin with manifest: false (manifest.json stays hand-authored per PWA: add manifest.json and iOS meta tags #3), injectRegister: false, registerType: "autoUpdate", workbox.generateSW strategy, maximumFileSizeToCacheInBytes: 8 * 1024 * 1024 (default 2 MiB was too small for the editor bundle's main entry chunk)
apps/web/src/main.tsx: manual, Electron-guarded SW registration — navigator.serviceWorker.register("/sw.js") inside an else if ("serviceWorker" in navigator) branch alongside the existing isElectron check, since Electron loads this same bundle over a custom protocol (t3code://app/), not a real origin
Why manual registration instead of the plugin's virtual:pwa-register helper: that virtual module failed to resolve workbox-window under this repo's rolldown-based vite-plus fork during production build, despite the package being correctly installed — a vite-plus/rolldown plugin-ecosystem gap, not a real missing dependency. Manual registration sidesteps the virtual module import entirely while still using generateSW for SW generation/precaching.
Verification:
vp run --filter @t3tools/web build → succeeds, dist/sw.js generated with a 407-entry (17220.67 KiB) precache manifest
Add
vite-plugin-pwa(new dependency — per map #1's decision) toapps/web/vite.config.ts, configure Workbox precaching for static assets, register the service worker inmain.tsx.Part of map #1.