-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathsvelte.config.js
executable file
·43 lines (38 loc) · 961 Bytes
/
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
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
import { escapeSvelte, mdsvex } from 'mdsvex';
import { createHighlighter } from 'shiki';
import adapter from 'svelte-adapter-bun';
/** @type {import('@sveltejs/kit').Config} */
const config = {
extensions: ['.svelte', '.md', '.svx'],
kit: {
adapter: adapter({
out: 'build',
precompress: true
}),
csrf: {
checkOrigin: false
},
files: {
lib: './src/lib/'
}
},
preprocess: [
vitePreprocess(),
mdsvex({
extensions: ['.md'],
highlight: {
highlighter: async (code, lang = 'text') => {
await highlighter.loadLanguage('javascript', 'typescript', 'prisma');
const html = escapeSvelte(highlighter.codeToHtml(code, { lang, theme: 'poimandres' }));
return `{@html \`${html}\` }`;
}
}
})
]
};
const highlighter = await createHighlighter({
langs: ['javascript', 'typescript', 'prisma'],
themes: ['poimandres']
});
export default config;