import adapter from '@sveltejs/adapter-static';

/** @type {import('@sveltejs/kit').Config} */
const config = {
	compilerOptions: {
		// Force runes mode for the project, except for libraries.
		runes: ({ filename }) => (filename.split(/[/\\]/).includes('node_modules') ? undefined : true)
	},
	kit: {
		// SPA mode: every unknown path serves index.html, which then mounts
		// the client router. Required for dynamic routes (e.g. /photo/[uid]).
		adapter: adapter({
			fallback: 'index.html'
		})
	}
};

export default config;
