Story 4: Enable SvelteKit Service Worker Registration - Enable serviceWorker.register: true in svelte.config.js - SvelteKit now handles service worker registration automatically - Service worker builds successfully as service-worker.mjs - Build and preview work without conflicts - Ready for comprehensive testing Migration to native SvelteKit PWA implementation complete Refs: docs/plans/MigrateToNativeSvelteKitPWA.md
18 lines
461 B
JavaScript
18 lines
461 B
JavaScript
import adapter from '@sveltejs/adapter-node';
|
|
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
|
|
|
|
/** @type {import('@sveltejs/kit').Config} */
|
|
const config = {
|
|
// Consult https://svelte.dev/docs/kit/integrations
|
|
// for more information about preprocessors
|
|
preprocess: vitePreprocess(),
|
|
kit: {
|
|
adapter: adapter(),
|
|
serviceWorker: {
|
|
register: true // Enable SvelteKit's native service worker registration
|
|
}
|
|
}
|
|
};
|
|
|
|
export default config;
|