-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
35 lines (29 loc) · 831 Bytes
/
Copy pathvite.config.ts
File metadata and controls
35 lines (29 loc) · 831 Bytes
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
import { sveltekit } from "@sveltejs/kit/vite";
import { defineConfig } from "vitest/config";
function shikiGrammarChunk(id: string): string | undefined {
const normalizedId = id.replaceAll("\\", "/");
if (normalizedId.includes("/node_modules/@shikijs/langs/dist/cpp-macro.mjs")) {
return "shiki-lang-cpp-macro";
}
if (normalizedId.includes("/node_modules/@shikijs/langs/dist/regexp.mjs")) {
return "shiki-lang-regexp";
}
if (normalizedId.includes("/node_modules/@shikijs/langs/dist/glsl.mjs")) {
return "shiki-lang-glsl";
}
return undefined;
}
export default defineConfig({
plugins: [sveltekit()],
build: {
rollupOptions: {
output: {
manualChunks: shikiGrammarChunk,
},
},
},
test: {
environment: "node",
include: ["tests/unit/**/*.test.ts"],
},
});