-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsvelte.config.js
37 lines (34 loc) · 997 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
import adapter from '@sveltejs/adapter-static';
import { mdsvex, escapeSvelte } from 'mdsvex';
import { createHighlighter } from 'shiki';
import rehypeExternalLinks from 'rehype-external-links';
const theme = 'material-theme-darker';
const highlighter = await createHighlighter({
themes: [theme],
langs: ['javascript', 'typescript', 'svelte', 'bash', 'diff']
});
/** @type {import('@sveltejs/kit').Config} */
const config = {
preprocess: mdsvex({
layout: {
_: 'src/lib/components/docs/DocLayout.svelte'
},
highlight: {
highlighter: async (code, lang = 'text') => {
const html = escapeSvelte(highlighter.codeToHtml(code, { lang, theme }));
return `{@html \`${html}\` }`;
}
},
rehypePlugins: [[rehypeExternalLinks, { rel: [], target: '_blank' }]]
}),
extensions: ['.svelte', '.svx'],
kit: {
adapter: adapter({
fallback: 'index.html'
}),
alias: {
'$lib/*': './src/lib/*'
}
}
};
export default config;