summaryrefslogtreecommitdiffstatshomepage
path: root/frontend/svelte.config.js
blob: dbfdf532aaaa4bf7ef3918b63fa46a9408a3d81a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/* eslint-disable @typescript-eslint/no-unused-vars */
import adapter from '@sveltejs/adapter-static';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
import { readFileSync } from 'fs';
import { fileURLToPath } from 'url';

const packageFile = fileURLToPath(new URL('package.json', import.meta.url));
const packageJSON = readFileSync(packageFile, 'utf8');
const pkg = JSON.parse(packageJSON);

/** @type {import('@sveltejs/kit').Config} */
const config = {
	// Consult https://kit.svelte.dev/docs/integrations#preprocessors
	// for more information about preprocessors
	preprocess: vitePreprocess(),

	kit: {
		adapter: adapter({
			fallback: 'index.html',
			pages: '../src/hircine/static/app'
		}),
		prerender: { entries: [] },
		alias: {
			$gql: './src/gql'
		},
		version: {
			name: pkg.version
		},
		typescript: {
			config: (tsconfig) => {
				const { ...compilerOptions } = tsconfig.compilerOptions;

				return {
					...tsconfig,
					compilerOptions: {
						...compilerOptions
					}
				};
			}
		}
	}
};

export default config;