diff --git a/src/app/call.ts b/src/app/call.ts index bfa3cd81..86ff51f7 100644 --- a/src/app/call.ts +++ b/src/app/call.ts @@ -4,15 +4,15 @@ */ import { DisconnectReason, - LocalParticipant, - LocalTrackPublication, - Participant, Room as LiveKitRoom, RoomEvent, Track, - TrackPublication, supportsAudioOutputSelection, type AudioCaptureOptions, + type LocalParticipant, + type LocalTrackPublication, + type Participant, + type TrackPublication, } from "livekit-client" import {App} from "@capacitor/app" import {derived, get, writable} from "svelte/store" diff --git a/src/app/components/QRCode.svelte b/src/app/components/QRCode.svelte index af21fe0e..aec6e104 100644 --- a/src/app/components/QRCode.svelte +++ b/src/app/components/QRCode.svelte @@ -1,5 +1,4 @@ diff --git a/vite.config.ts b/vite.config.ts index cf592a0a..c4c9cec1 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -47,8 +47,20 @@ export default defineConfig({ SvelteKitPWA({ registerType: "autoUpdate", injectRegister: "auto", + // adapter-static writes the fallback shell after the service worker is generated, so the + // plugin can't glob it — this precaches "/" explicitly, giving workbox's navigation + // fallback something to bind to. + kit: { + spa: true, + adapterFallback: "/", + }, workbox: { maximumFileSizeToCacheInBytes: 5 * 1024 ** 2, // 5 MB or set to something else + // The service worker is generated before SvelteKit prerenders anything, so the + // "prerendered/**" glob @vite-pwa/sveltekit forces in never matches. It only forces it + // when modifyURLPrefix is unset, and an empty one is a no-op. + modifyURLPrefix: {}, + globPatterns: ["client/**/*.{js,css,ico,png,svg,webp,webmanifest}"], }, manifest: { name: process.env.VITE_PLATFORM_NAME,