-
Notifications
You must be signed in to change notification settings - Fork 0
/
svelte.config.js
68 lines (65 loc) · 1.78 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
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
// import adapter from '@sveltejs/adapter-vercel';
// import adapter from '@sveltejs/adapter-static';
import adapter from '@sveltejs/adapter-auto';
import { vitePreprocess } from '@sveltejs/kit/vite';
import { mdsvex } from 'mdsvex';
import preprocess from 'svelte-preprocess';
const rootDomain = process.env.VITE_DOMAIN; // or your server IP for dev
/** @type {import('@sveltejs/kit').Config} */
const config = {
extensions: ['.svelte', '.md', '.svx'],
preprocess: [
vitePreprocess(),
mdsvex({
extensions: ['.md', '.svx']
}),
preprocess({
scss: true,
postcss: true
})
],
kit: {
adapter: adapter(),
alias: {
'@content': '/src/content/*'
},
csp: {
mode:"auto",
directives: {
'base-uri': ["'self'"],
'child-src': ["'self'"],
'connect-src': ["'self'", 'ws://localhost:*'],
'img-src': ["'self'", 'data:'],
'font-src': ["'self'", 'data:'],
'form-action': ["'self'"],
'frame-ancestors': ["'self'"],
'frame-src': [
"'self'",
"*.youtube.com",
],
// 'manifest-src': ["'self'"],
// 'media-src': ["'self'", 'data:'],
// 'object-src': ["'none'"],
'style-src': ["'self'", "'unsafe-inline'"],
'default-src': [
'self',
...(rootDomain ? [rootDomain, `ws://${rootDomain}`] : []),
],
'script-src': [
'self',
"nonce-363cb650-276b-5ec4-8ba9-983617dca07e",
"*.vercel-insights.com",
"vercel-analytics.com",
"*.vercel-analytics.com"
],
// 'worker-src': ["'self'"],
// remove report-to & report-uri if you do not want to use Sentry reporting
// 'report-to': ["'csp-endpoint'"],
// 'report-uri': [
// `https://sentry.io/api/${process.env.VITE_SENTRY_PROJECT_ID}/security/?sentry_key=${process.env.VITE_SENTRY_KEY}`,
// ],
}
},
}
};
export default config;