11f51944df
SvelteKit's automatic SW registration also runs under `vite dev`, where the worker intercepted/cached the dev-server e2e suite (42 failures). Disable auto-registration (kit.serviceWorker.register: false) and register the worker manually from the root layout guarded by `!dev`, so `vite dev` and the e2e suite run worker-free while the production build — and the PWA preview test — still install it. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
22 lines
580 B
JavaScript
22 lines
580 B
JavaScript
import adapter from "@sveltejs/adapter-static";
|
|
import { vitePreprocess } from "@sveltejs/vite-plugin-svelte";
|
|
|
|
/** @type {import('@sveltejs/kit').Config} */
|
|
export default {
|
|
preprocess: vitePreprocess(),
|
|
kit: {
|
|
adapter: adapter({
|
|
pages: "build",
|
|
assets: "build",
|
|
fallback: "index.html",
|
|
strict: true,
|
|
}),
|
|
serviceWorker: {
|
|
// Registered manually in the root layout for production only.
|
|
// SvelteKit's auto-registration also runs under `vite dev`, where
|
|
// the worker would intercept and cache the dev-server e2e suite.
|
|
register: false,
|
|
},
|
|
},
|
|
};
|