/ svelte.config.js
svelte.config.js
 1  import adapter from '@sveltejs/adapter-static';
 2  import { relative, sep } from 'node:path';
 3  
 4  /** @type {import('@sveltejs/kit').Config} */
 5  const config = {
 6  	compilerOptions: {
 7  		// defaults to rune mode for the project, except for `node_modules`. Can be removed in svelte 6.
 8  		runes: ({ filename }) => {
 9  			const relativePath = relative(import.meta.dirname, filename);
10  			const pathSegments = relativePath.toLowerCase().split(sep);
11  			const isExternalLibrary = pathSegments.includes('node_modules');
12  
13  			return isExternalLibrary ? undefined : true;
14  		}
15  	},
16  	kit: {
17  		// adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list.
18  		// If your environment is not supported, or you settled on a specific environment, switch out the adapter.
19  		// See https://svelte.dev/docs/kit/adapters for more information about adapters.
20  		adapter: adapter({
21  			fallback: 'index.html' // SPA mode
22  		})
23  	}
24  };
25  
26  export default config;