-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsvelte.config.js
More file actions
40 lines (38 loc) · 869 Bytes
/
Copy pathsvelte.config.js
File metadata and controls
40 lines (38 loc) · 869 Bytes
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
import { vitePreprocess } from '@sveltejs/kit/vite';
import { mdsvex } from 'mdsvex';
import adapter from '@sveltejs/adapter-vercel';
/** @type {import('@sveltejs/kit').Config} */
const config = {
kit: {
adapter: adapter({
runtime: 'nodejs22.x',
split: false
}),
prerender: {
handleHttpError: 'warn',
handleMissingId: 'warn',
entries: ['*']
}
},
extensions: ['.svelte', '.md'],
preprocess: [
vitePreprocess(),
mdsvex({
extensions: ['.md'],
remarkPlugins: [
() => (tree, file) => {
// The content starts after the frontmatter
const match = file.contents.match(/---\n([\s\S]*?)\n---\n([\s\S]*)/);
if (match) {
// match[2] contains everything after the frontmatter
file.data.fm = {
...file.data.fm,
rawContent: match[2].trim()
};
}
}
]
})
]
};
export default config;