Repository navigation
Expand file tree
/
Copy pathsvelte.config.js
More file actions
72 lines (65 loc) · 2.27 KB
/
Copy pathsvelte.config.js
File metadata and controls
72 lines (65 loc) · 2.27 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
import { mdsvex } from 'mdsvex';
/** @type {import('mdsvex').MdsvexOptions} */
const mdsvexOptions = {
extensions: ['.md']
};
/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://svelte.dev/docs/kit/integrations
// for more information about preprocessors
preprocess: [vitePreprocess(), mdsvex(mdsvexOptions)],
kit: {
// adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list.
// If your environment is not supported, or you settled on a specific environment, switch out the adapter.
// See https://svelte.dev/docs/kit/adapters for more information about adapters.
adapter:
process.env.ADAPTER === 'node'
? (await import('@sveltejs/adapter-node')).default()
: (await import('@sveltejs/adapter-vercel')).default(),
csrf: { checkOrigin: process.env.CSRF_CHECK_ORIGIN === 'false' ? false : true }, // For debug purposes only
csp: {
mode: 'auto',
directives: {
'default-src': ['none'],
'script-src': [
'self',
// Hash of mode-watcher's inline anti-FOUC `setInitialMode` script in <head>.
// SvelteKit doesn't nonce library-injected head scripts, so it must be
// allowlisted by hash. Re-check this if mode-watcher is upgraded or its
// <ModeWatcher> props change (the inline script content would change).
'sha256-cIZByCqcmZEwY5l704mu2OYBzfdBwMjhGZvxBc2yUeE=',
'https://js.stripe.com',
'https://vercel.live',
'https://www.google.com',
'https://www.gstatic.com'
],
'style-src': ['self', 'unsafe-inline'],
'img-src': [
'self',
'data:',
'blob:',
'https://*.os.zrh1.flow.swiss',
'https://scrt-link.imgix.net',
'https://lh3.googleusercontent.com'
],
'media-src': ['self'],
'connect-src': ['self', 'data:', 'https://*.os.zrh1.flow.swiss', 'https://plausible.io'],
'frame-src': [
'self',
'https://js.stripe.com',
'https://vercel.live',
'https://www.google.com'
],
'worker-src': ['self'],
'object-src': ['none'],
'base-uri': ['self'],
'frame-ancestors': ['none'],
'form-action': ['self'],
'manifest-src': ['self']
}
}
},
extensions: ['.svelte', '.svx', '.md']
};
export default config;