The vite resolve.alias (added for the client + coverage runs) does not reach svelte-check, which resolves paths through the generated tsconfig. Declaring $mocks in kit.alias feeds both the generated tsconfig paths and the sveltekit() vite plugin, so editor/type-check resolve it too. Part of #560. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
31 lines
1.1 KiB
JavaScript
31 lines
1.1 KiB
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(),
|
|
// $mocks resolves shared browser-test mock bodies (src/__mocks__). Declared here
|
|
// so svelte-check/tsconfig and both vite configs resolve it. See ADR-012.
|
|
alias: {
|
|
$mocks: 'src/__mocks__'
|
|
},
|
|
prerender: {
|
|
entries: ['/hilfe/transkription'],
|
|
// Disable crawl: by default SvelteKit follows nav links from
|
|
// prerendered pages and prerenders the targets too. The targets
|
|
// (/, /documents, /persons, …) throw redirect('/login') during
|
|
// the build (no auth cookie), so SvelteKit bakes a
|
|
// `<script>location.href='/login'</script>` HTML page and serves
|
|
// it before the runtime hooks ever run. Result: authenticated
|
|
// users with a valid cookie still get bounced. See #514.
|
|
crawl: false
|
|
}
|
|
}
|
|
};
|
|
|
|
export default config;
|