-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsvelte.config.js
62 lines (57 loc) · 1.45 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
import adapter from '@sveltejs/adapter-static';
import { vitePreprocess } from '@sveltejs/kit/vite';
import { escapeSvelte, mdsvex } from 'mdsvex';
import shiki from 'shiki';
import remarkUnwrapImages from 'remark-unwrap-images';
import remarkToc from 'remark-toc';
import rehypeSlug from 'rehype-slug';
/** @type {import('mdsvex').MdsvexOptions}*/
const mdsvexConfig = {
extensions: ['.md'],
// layout: {
// _: './src/mdsvex.svelte',
// },
highlight: {
highlighter: async (code, lang) => {
const highlighter = await shiki.getHighlighter({
theme: 'slack-dark'
});
const result = escapeSvelte(highlighter.codeToHtml(code, { lang }));
return `{@html \`${result}\`}`;
}
},
remarkPlugins: [
remarkUnwrapImages,
remarkToc,
],
rehypePlugins: [
rehypeSlug,
],
};
/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://kit.svelte.dev/docs/integrations#preprocessors
// for more information about preprocessors
preprocess: [vitePreprocess(), mdsvex(mdsvexConfig)],
extensions: ['.svelte', '.md'],
kit: {
adapter: adapter({
// default options are shown. On some platforms
// these options are set automatically — see below
pages: 'build',
assets: 'build',
fallback: null,
precompress: false,
strict: true
})
},
vitePlugin: {
inspector: {
// ctrl+alt+s
toggleKeyCombo: 'control-alt-s',
showToggleButton: 'always',
toggleButtonPos:'bottom-right'
}
}
};
export default config;