Enable svelte preprocess

This commit is contained in:
Damien Elmes 2024-05-17 17:01:49 +07:00
parent eac3daa385
commit d64ea23e11

View file

@ -2,6 +2,7 @@ import adapter from "@sveltejs/adapter-static";
import { vitePreprocess } from "@sveltejs/vite-plugin-svelte";
import { dirname, join } from "path";
import { fileURLToPath } from "url";
import preprocess from 'svelte-preprocess';
// This prevents errors being shown when opening VSCode on the root of the
// project, instead of the ts folder.
@ -9,7 +10,8 @@ const tsFolder = dirname(fileURLToPath(import.meta.url));
/** @type {import('@sveltejs/kit').Config} */
const config = {
preprocess: vitePreprocess(),
// preprocess() slows things down by about 10%, but allows us to use :global { ... }
preprocess: [vitePreprocess(), preprocess()],
kit: {
adapter: adapter(