-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
42 lines (40 loc) · 1.05 KB
/
vite.config.ts
File metadata and controls
42 lines (40 loc) · 1.05 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
/// <reference types="vitest/config" />
import { cloudflare } from "@cloudflare/vite-plugin";
import tailwindcss from "@tailwindcss/vite";
import { defineConfig } from "vite";
import ssrPlugin from "vite-ssr-components/plugin";
export default defineConfig(({ mode }) => {
// Exclude Cloudflare plugin during test mode to avoid conflicts
const isTest = mode === "test" || process.env.VITEST === "true";
return {
plugins: isTest
? [tailwindcss()]
: [cloudflare(), ssrPlugin(), tailwindcss()],
test: {
exclude: ["src/renderer.tsx", "node_modules/**"],
environment: "node",
globals: true,
coverage: {
include: ["src/**/*.{ts,tsx}"],
exclude: [
"src/renderer.tsx",
"src/index.tsx",
"src/client.tsx",
"src/compressWorker.ts",
"src/pixoWorker.ts",
"src/pixoClient.tsx",
"**/*.d.ts",
"node_modules/**",
],
thresholds: {
lines: 70,
branches: 70,
functions: 70,
statements: 70,
},
reportsDirectory: "./coverage",
reporter: ["text", "html", "lcov"],
},
},
};
});