import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'; // โ˜๏ธ Adapter: import adapter from '@sveltejs/adapter-node'; // ๐Ÿ“ฆ Extensions: import { mdsvex, escapeSvelte } from 'mdsvex'; import { createHighlighter, makeSingletonHighlighter } from 'shiki'; // ๐Ÿ“„ Markdown config: const getHighlighter = makeSingletonHighlighter(createHighlighter); /** @type {import('mdsvex').MdsvexOptions} */ const mdsvexOptions = { extensions: ['.md'], highlight: { highlighter: async (code, lang = 'text') => { const highlighter = await getHighlighter({ themes: ['vesper'], langs: ['javascript', 'typescript', 'bash', 'json'] }); await highlighter.loadLanguage('javascript', 'typescript', 'bash'); const html = escapeSvelte(highlighter.codeToHtml(code, { lang, theme: 'vesper' })); return `{@html \`${html}\` }`; } } }; // ๐Ÿงก Svelte config: /** @type {import('@sveltejs/kit').Config} */ const config = { extensions: ['.svelte', '.md'], preprocess: [vitePreprocess(), mdsvex(mdsvexOptions)], kit: { adapter: adapter(), alias: { '@': './src/*' } } }; export default config;