aboutsummaryrefslogtreecommitdiffstats
path: root/svelte.config.js
diff options
context:
space:
mode:
Diffstat (limited to 'svelte.config.js')
-rw-r--r--svelte.config.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/svelte.config.js b/svelte.config.js
new file mode 100644
index 0000000..d4f1eff
--- /dev/null
+++ b/svelte.config.js
@@ -0,0 +1,24 @@
+import adapter from '@sveltejs/adapter-static';
+import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
+import importMap from './import_map.json' with { type: 'json' };
+
+/** @type {import('@sveltejs/kit').Config} */
+const config = {
+ preprocess: vitePreprocess(),
+ kit: {
+ adapter: adapter({
+ fallback: '404.html',
+ }),
+ alias: Object.fromEntries(
+ Object.entries(importMap.imports).filter(([k]) =>
+ k !== '$lib' && k !== '$lib/'
+ ).map(([k, v]) =>
+ v.startsWith('npm:')
+ ? 'npm:' + k === v ? [] : [k, 'node_modules/' + v.substring(4)]
+ : [k, v]
+ ).filter((v) => v.length !== 0),
+ ),
+ },
+};
+
+export default config;