-
-
Notifications
You must be signed in to change notification settings - Fork 66
/
svelte.config.js
41 lines (39 loc) · 1.08 KB
/
svelte.config.js
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
33
34
35
36
37
38
39
40
41
// svelte adapter
import adapterAuto from '@sveltejs/adapter-auto'
import adapterNode from '@sveltejs/adapter-node'
import adapterStatic from '@sveltejs/adapter-static'
// svelte preprocessor
import { mdsvex } from 'mdsvex'
import mdsvexConfig from './mdsvex.config.js'
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'
const adapter = {
auto: adapterAuto(),
node: adapterNode(),
static: adapterStatic({
pages: 'build',
assets: 'build',
fallback: undefined
})
}
/** @type {import("@svletejs/kit".Config)} */
export default {
extensions: ['.svelte', ...mdsvexConfig.extensions],
preprocess: [mdsvex(mdsvexConfig), vitePreprocess()],
kit: {
adapter:
process.env.ADAPTER
? adapter[process.env.ADAPTER.toLowerCase()]
: Object.keys(process.env).some(key => ['VERCEL', 'NETLIFY'].includes(key))
? adapter['auto']
: adapter['static'],
prerender: {
handleMissingId: 'warn'
},
csp: {
mode: 'auto',
directives: {
'style-src': ['self', 'unsafe-inline', 'https://giscus.app']
}
}
}
}