summaryrefslogtreecommitdiffstatshomepage
path: root/frontend/svelte.config.js
diff options
context:
space:
mode:
authorWolfgang Müller2024-03-05 18:08:09 +0100
committerWolfgang Müller2024-03-05 19:25:59 +0100
commitd1d654ebac2d51e3841675faeb56480e440f622f (patch)
tree56ef123c1a15a10dfd90836e4038e27efde950c6 /frontend/svelte.config.js
downloadhircine-d1d654ebac2d51e3841675faeb56480e440f622f.tar.gz
Initial commit0.1.0
Diffstat (limited to 'frontend/svelte.config.js')
-rw-r--r--frontend/svelte.config.js44
1 files changed, 44 insertions, 0 deletions
diff --git a/frontend/svelte.config.js b/frontend/svelte.config.js
new file mode 100644
index 0000000..dbfdf53
--- /dev/null
+++ b/frontend/svelte.config.js
@@ -0,0 +1,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;