-
Notifications
You must be signed in to change notification settings - Fork 0
/
svelte.config.ts
32 lines (30 loc) · 1016 Bytes
/
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
32
// sveltekit config type
import type { Config } from '@sveltejs/kit'
// svelte adapter
import adapterVercel from '@sveltejs/adapter-vercel'
import adapterNetlify from '@sveltejs/adapter-netlify'
import adapterStatic from '@sveltejs/adapter-static'
// svelte preprocessor
import { mdsvex } from 'mdsvex'
import mdsvexConfig from './mdsvex.config.js'
import { vitePreprocess } from '@sveltejs/kit/vite'
const defineConfig = (config: Config) => config
export default defineConfig({
extensions: ['.svelte', ...(mdsvexConfig.extensions as string[])],
preprocess: [mdsvex(mdsvexConfig), vitePreprocess()],
kit: {
adapter: Object.keys(process.env).some(key => key === 'VERCEL')
? adapterVercel()
: Object.keys(process.env).some(key => key === 'NETLIFY')
? adapterNetlify({ edge: true })
: adapterStatic({
pages: 'build',
assets: 'build',
fallback: undefined
}),
prerender: {
handleMissingId: 'warn'
},
csp: { mode: 'auto' }
}
})