-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathvite.config.ts
More file actions
49 lines (43 loc) 路 1.29 KB
/
Copy pathvite.config.ts
File metadata and controls
49 lines (43 loc) 路 1.29 KB
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
47
48
49
import adapter from "@sveltejs/adapter-node"
import { sveltekit } from "@sveltejs/kit/vite"
import { vitePreprocess } from "@sveltejs/vite-plugin-svelte"
import unocss from "@unocss/vite"
import evlog from "evlog/vite"
import sonda from "sonda/vite"
import { defineConfig } from "vitest/config"
import manifest from "./package.json" with { type: "json" }
export default defineConfig((env) => ({
build: {
sourcemap: process.env.ANALYZE != null,
},
css: {
transformer: "lightningcss",
},
optimizeDeps: { include: ["canvas-confetti", "dotaver"] },
define: {
REPOSITORY: JSON.stringify(manifest.repository),
},
plugins: [
unocss({ mode: env.command === "build" ? "per-module" : "global" }),
sveltekit({
experimental: { remoteFunctions: true },
compilerOptions: { experimental: { async: true }, modernAst: true },
adapter: adapter({ precompress: false }),
preprocess: vitePreprocess(),
serviceWorker: {
register: true,
options: { type: "module" },
},
}),
evlog({ service: "itpo-sveltekit", sourceLocation: "dev" }),
sonda({ sources: true, deep: true, enabled: process.env.ANALYZE != null }),
],
server: {
headers: {
"Cache-Control": "public, max-age=0",
},
},
test: {
environment: "node",
},
}))