import adapter from '@sveltejs/adapter-static';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';

/** @type {import('@sveltejs/kit').Config} */
const config = {
	preprocess: vitePreprocess(),
	kit: {
		// SPA build: Caddy serves these files in prod, falls back to
		// index.html for client-side routing. Mounted at /admin so
		// the rest of the URL space is free for user-defined routes.
		paths: {
			base: '/admin'
		},
		adapter: adapter({
			fallback: 'index.html',
			pages: 'build',
			assets: 'build',
			precompress: false,
			strict: false
		})
	}
};

export default config;
