-
Notifications
You must be signed in to change notification settings - Fork 7
/
vite.config.ts
46 lines (43 loc) · 1.05 KB
/
vite.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/// <reference types="vitest" />
import { defineConfig } from "vite";
import analog from "@analogjs/platform";
import * as fs from "fs";
const lectures = fs.readdirSync("./src/content/lectures");
const coursework = fs.readdirSync("./src/content/coursework");
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => ({
publicDir: "src/assets",
build: {
target: ["es2020"],
},
resolve: {
mainFields: ["module"],
},
plugins: [
analog({
prerender: {
routes: async () => [
"/",
"/lectures",
...lectures.map((post) => `/lectures/${post.replace(".md", "")}`),
...coursework.map((post) => `/work/${post.replace(".md", "")}`),
"/work",
"/team",
"/resources",
],
sitemap: {
host: "https://cscc09.com",
},
},
}),
],
test: {
globals: true,
environment: "jsdom",
setupFiles: ["src/test.ts"],
include: ["**/*.spec.ts"],
},
define: {
"import.meta.vitest": mode !== "production",
},
}));