-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
svelte.config.ts
31 lines (30 loc) · 1 KB
/
svelte.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// sveltekit config type
import type { Config } from '@sveltejs/kit'
// svelte adapter
import adapterNode from '@sveltejs/adapter-node'
import adapterStatic from '@sveltejs/adapter-static'
import adapterVercel from '@sveltejs/adapter-vercel'
// svelte preprocessor
import { mdsvex } from 'mdsvex'
import mdsvexConfig from './mdsvex.config.js'
import preprocess from 'svelte-preprocess'
export default {
extensions: ['.svelte', ...(mdsvexConfig.extensions as string[])],
preprocess: [mdsvex(mdsvexConfig), preprocess({ preserve: ['partytown'] })],
kit: {
adapter: Object.keys(process.env).some(key => ['VERCEL', 'CF_PAGES', 'NETLIFY'].includes(key))
? adapterVercel()
// ? adapterVercel({ edge: true })
: process.env.ADAPTER === 'node'
? adapterNode({ out: 'build' })
: adapterStatic({
pages: 'build',
assets: 'build',
fallback: undefined
}),
prerender: {
handleMissingId: 'warn'
},
csp: { mode: 'auto' }
}
} satisfies Config