summaryrefslogtreecommitdiffstatshomepage
path: root/frontend/svelte.config.js
diff options
context:
space:
mode:
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;