-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathsvelte.config.js
More file actions
52 lines (48 loc) · 1.34 KB
/
svelte.config.js
File metadata and controls
52 lines (48 loc) · 1.34 KB
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
import autoprefixer from 'autoprefixer'
import adapter from '@sveltejs/adapter-static'
import { mdsvex } from 'mdsvex'
import rehypeAutolinkHeadings from 'rehype-autolink-headings'
import rehypeSlug from 'rehype-slug'
import { sveltePreprocess } from 'svelte-preprocess'
import { myFootnoteRehypePlugin } from './src/lib/assets/js/footnoteRehypePlugin.js'
/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://github.com/sveltejs/svelte-preprocess
// for more information about preprocessors
extensions: ['.svelte', '.md'],
preprocess: [
mdsvex({
extensions: ['.md'],
highlight: {
alias: { vue: 'html' }
},
rehypePlugins: [
rehypeSlug,
rehypeAutolinkHeadings,
myFootnoteRehypePlugin
]
}),
sveltePreprocess({
postcss: {
plugins: [autoprefixer]
}
})
],
kit: {
adapter: adapter({
fallback: '404.html'
})
},
compilerOptions: {
// This is a temporary workaround to suppress warnings about the way I'm handling footnotes in the custom rehype plugin. The warnings are expected and don't indicate any actual issues, but they were cluttering up the console during development.
warningFilter: (warning) => {
if (
warning.code === 'element_implicitly_closed' &&
warning.message.includes('</footnote>')
)
return false
return true
}
}
}
export default config