From d57a5985982ed2ba386eb4c0b4ca05ab3498238a Mon Sep 17 00:00:00 2001 From: memdmp Date: Sat, 11 Jan 2025 20:20:16 +0100 Subject: feat: initial commit --- svelte.config.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 svelte.config.js (limited to 'svelte.config.js') 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; -- cgit v1.2.3