-
Notifications
You must be signed in to change notification settings - Fork 92
/
Copy pathsvelte.config.js
71 lines (65 loc) · 1.62 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
63
64
65
66
67
68
69
70
71
import preprocess from 'svelte-preprocess';
import adapter from '@sveltejs/adapter-auto';
import { mdsvex } from 'mdsvex';
import remarkGithub from 'remark-github';
import remarkAbbr from 'remark-abbr';
import rehypeSlug from 'rehype-slug';
import rehypeAutolinkHeadings from 'rehype-autolink-headings';
// mdsvex config
const mdsvexConfig = {
extensions: ['.svelte.md', '.md', '.svx'],
layout: {
_: './src/mdsvexlayout.svelte' // default mdsvex layout
},
remarkPlugins: [
[
remarkGithub,
{
// Use your own repository
repository: 'https://github.com/mvasigh/sveltekit-mdsvex-blog.git'
}
],
remarkAbbr
],
rehypePlugins: [
rehypeSlug,
[
rehypeAutolinkHeadings,
{
behavior: 'wrap'
}
]
]
};
/** @type {import('@sveltejs/kit').Config} */
const config = {
extensions: ['.svelte', '.html', '.svx', ...mdsvexConfig.extensions],
preprocess: [
mdsvex(mdsvexConfig),
preprocess({
postcss: true
})
],
// Docs: https://github.com/sveltejs/kit/blob/master/packages/adapter-netlify/README.md
kit: {
adapter: adapter({
split: false,
// nov 2022
// if true, will create a Netlify Edge Function rather
// than using standard Node-based functions. however, also uses esbuild, which as of nov 2022 has a bug on netlify
// https://github.com/sveltejs/kit/issues/7839#issuecomment-1328605300
// dec 2022 - moved back to true since we're using esbuild again
edge: true,
}),
// https://kit.svelte.dev/docs/configuration#csp
// csp: {
// directives: {
// 'script-src': ['self']
// },
// reportOnly: {
// 'script-src': ['self']
// }
// }
}
};
export default config;