import adapter from "@sveltejs/adapter-static";
import { typescript, scss } from 'svelte-preprocess';
import { cssModules } from 'svelte-preprocess-cssmodules';
import { mdsvex } from "mdsvex";

/** @type {import('@sveltejs/kit').Config} */
const config = {
	base: '',
	extensions: [".svelte", ".md"],
	emitCss: true,
	preprocess: [
		mdsvex({
			// The default mdsvex extension is .svx; this overrides that.
			extensions: [".md"],

			layout: {
				_: 'src/lib/Layout.svelte',
			},

			// Adds IDs to headings, and anchor links to those IDs. Note: must stay in this order to work.
			rehypePlugins: [
				// rehypeSlug,
				// rehypeAutolinkHeadings,
			],
		}),
		scss(),
		cssModules({
			mode: "scoped"
		}),
	],
	paths: {
		relative: true,
	},
	kit: {
		alias: {
			'src': './src/',
		},
		paths: {
			relative: false,
		},
		files: {
			// assets: "./static",
		},
		adapter: adapter({
			// default options are shown. On some platforms
			// these options are set automatically — see below
			pages: 'build',
			assets: 'build',
			fallback: undefined,
			precompress: true,
			strict: true,
		}),
	},
};

export default config;
