-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsvelte.config.js
63 lines (59 loc) · 1.74 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
import adapter from "@sveltejs/adapter-node"
import { vitePreprocess } from "@sveltejs/vite-plugin-svelte"
import { mdsvex, escapeSvelte } from "mdsvex"
import { getSingletonHighlighter } from "shiki"
const highlighter = await getSingletonHighlighter({
themes: ["github-dark"],
langs: ["javascript", "typescript", "bash", "cmd", "yml", "yaml", "pascal"]
})
/** @type {import('mdsvex').MdsvexOptions} */
const mdsvexOptions = {
extensions: [".md"],
highlight: {
highlighter: async (code, lang = "text") => {
try {
const html = escapeSvelte(highlighter.codeToHtml(code, { lang, theme: "github-dark" }))
return `{@html \`${html}\` }`
} catch (error) {
lang = "cmd"
const html = escapeSvelte(highlighter.codeToHtml(code, { lang, theme: "github-dark" }))
return `{@html \`${html}\` }`
}
}
}
}
/** @type {import('@sveltejs/kit').Config} */
const config = {
extensions: [".svelte", ".md"],
preprocess: [vitePreprocess(), mdsvex(mdsvexOptions)],
vitePlugin: { inspector: true },
kit: {
adapter: adapter(),
csp: {
mode: "auto",
directives: {
"frame-src": [
"self",
"https://stripe-data-exports.s3.amazonaws.com/",
"https://connect-js.stripe.com",
"https://js.stripe.com",
"https://www.youtube.com/"
],
"script-src": [
"self",
"https://db.waspscripts.com/",
"https://enqlpchobniylwpsjcqc.supabase.co/",
"https://js.stripe.com/",
"https://connect-js.stripe.com",
"sha256-NIGxH81XzlJ1MLZd3Miw/iZ1aTKLJT4aAbU5iVmRLTw=",
"unsafe-inline",
"sha256-PBmRLzA7Ofi7WtgbjS5vmS9t83AYv5oRRywasLtzZ9Y=", //dev
"sha256-k5HJr61/45h+hLBmZFy0IrJtHlGahgw6wXNW3ccZaAI=" //build
],
"base-uri": ["self"],
"object-src": ["none"]
}
}
}
}
export default config