import adapter from '@sveltejs/adapter-node'; import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'; /** @type {import('@sveltejs/kit').Config} */ const config = { preprocess: vitePreprocess(), compilerOptions: { compatibility: { componentApi: 4 // Enable Svelte 4 component API for dynamic mounting } }, kit: { adapter: adapter({ out: 'build', precompress: true }), prerender: { handleUnseenRoutes: 'ignore', handleHttpError: ({ path, referrer, message }) => { // Ignore 404s for static assets during prerendering // These will be available at runtime from the public directory if (path === '/favicon.ico' || path === '/og-image.png') { return; } // For other errors, throw to fail the build throw new Error(`${message} (${path})`); } } } }; export default config;