import adapter from '@sveltejs/adapter-static';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
import { mdsvex } from "mdsvex";
import attr from "rehype-attr";
import emoji from "remark-emoji";
import gfm from "remark-gfm";
import rehypeExternalLinks from "rehype-external-links";

/** @type {import('@sveltejs/kit').Config} */
export default {
	kit: {
		adapter: adapter({
			pages: 'build',
			assets: 'build',
			fallback: undefined,
			precompress: false,
			strict: true
		})
	},

	extensions: [".svelte", ".md"],

	preprocess: [
		vitePreprocess(),
		mdsvex({
			extensions: [".md"],
			remarkPlugins: [
				emoji,
				gfm
			],
			rehypePlugins: [
				[attr, { properties: 'attr' }],
				[rehypeExternalLinks, {
					target: "_blank"
				}]
			]
		})
	]
};
