-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsvelte.config.js
More file actions
56 lines (52 loc) · 1.39 KB
/
svelte.config.js
File metadata and controls
56 lines (52 loc) · 1.39 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
53
54
55
56
import adapterVercel from '@sveltejs/adapter-vercel';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
import { escapeSvelte, mdsvex } from 'mdsvex';
import { join } from 'node:path';
import { highlighter } from './src/lib/data/highlighter.js';
import { transformerNotationFocus } from '@shikijs/transformers';
const ContentLayout = join(
import.meta.dirname,
'./src/lib/components/Content/ContentContext.svelte'
);
/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://svelte.dev/docs/kit/integrations
// for more information about preprocessors
preprocess: [
vitePreprocess(),
mdsvex({
layout: {
_: ContentLayout
},
extensions: ['.mdx'],
highlight: {
highlighter: async (code, lang, meta) => {
const html = escapeSvelte(
highlighter.codeToHtml(code, {
lang,
theme: 'vitesse-light',
transformers: [transformerNotationFocus()]
})
);
return `<Components.pre
meta=${JSON.stringify(encodeURI(meta))}
language=${lang}
>{@html \`${html}\`}</Components.pre>`;
}
}
})
],
kit: {
adapter: adapterVercel(),
alias: {
'@/*': 'src/*',
'$components/*': 'src/lib/components/*',
$unoconfig: './uno.config.ts',
'$content/*': './content/*',
'$data/*': './src/lib/data/*'
}
},
inlineStyleThreshold: 1024,
extensions: ['.svelte', '.mdx']
};
export default config;