import adapter from '@sveltejs/adapter-node'
import {vitePreprocess} from '@sveltejs/vite-plugin-svelte'
import {mdsvex} from "mdsvex"
import remarkTypograf from "@mavrin/remark-typograf"
import externalLinks from "./rehype/external-links.js"
import {shikiHighlighter} from "./shikiHighlighter.js"

/** @type {import('@sveltejs/kit').Config} */
const config = {
	extensions: ['.svelte', '.svx'],
	preprocess: [
		vitePreprocess(),
		mdsvex({
			highlight: {
				highlighter: shikiHighlighter
			},
			remarkPlugins: [
				remarkTypograf,
			],
			rehypePlugins: [
				externalLinks,
			]
		})
	],
	kit: {
		adapter: adapter()
	}
};

export default config;
