diff options
feat: initial commit
Diffstat (limited to 'svelte.config.js')
-rw-r--r-- | svelte.config.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/svelte.config.js b/svelte.config.js new file mode 100644 index 0000000..0568a73 --- /dev/null +++ b/svelte.config.js @@ -0,0 +1,30 @@ +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: { + paths: { + base: '', + }, + 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; |