-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsvelte.config.js
51 lines (44 loc) · 1.37 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
import adapter from '@sveltejs/adapter-vercel';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
import { mdsvex } from 'mdsvex';
import * as dvl from 'devlulcas-md';
import relativeImages from 'mdsvex-relative-images';
import rehypeAutolinkHeadings from 'rehype-autolink-headings';
import rehypeSlug from 'rehype-slug';
const blockQuoteTypes = [
{ prefix: 'tip', className: 'tip' },
{ prefix: 'warning', className: 'warning' },
{ prefix: 'danger', className: 'danger' },
{ prefix: 'info', className: 'info' },
{ prefix: 'success', className: 'success' },
{ prefix: 'note', className: 'note' },
{ prefix: 'important', className: 'important' },
{ prefix: 'caution', className: 'caution' },
{ prefix: 'error', className: 'error' }
];
/** @type {import('mdsvex').MdsvexOptions} */
export const mdsvexOptions = {
extensions: ['.md', '.svx', '.mdx'],
remarkPlugins: [
relativeImages,
dvl.remarkBetterImages,
[dvl.remarkCustomBlockquotes, { types: blockQuoteTypes }],
dvl.remarkExternalUrl
],
rehypePlugins: [rehypeSlug, [rehypeAutolinkHeadings, { behavior: 'wrap' }]]
};
/** @type {import('@sveltejs/kit').Config} */
const config = {
extensions: ['.svelte', '.svx', '.md'],
preprocess: [vitePreprocess(), mdsvex(mdsvexOptions)],
kit: {
adapter: adapter(),
prerender: {
entries: ['*']
},
alias: {
'$/*': 'src/*'
}
}
};
export default config;