summaryrefslogblamecommitdiffstatshomepage
path: root/frontend/svelte.config.js
blob: dbfdf532aaaa4bf7ef3918b63fa46a9408a3d81a (plain) (tree)











































                                                                                        
/* 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;