-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathvite.config.ts
More file actions
68 lines (63 loc) · 2.06 KB
/
vite.config.ts
File metadata and controls
68 lines (63 loc) · 2.06 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import { defineConfig, coverageConfigDefaults, configDefaults } from "vitest/config";
import { resolve } from "node:path";
import { fileURLToPath } from "node:url";
import { dirname } from "node:path";
import { existsSync } from "node:fs";
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
// Get project root and .env path
const projectRoot = resolve(__dirname, ".");
const envPath = resolve(projectRoot, ".env");
// Only include --env-file if .env exists (for CI compatibility)
const execArgv = ["--openssl-legacy-provider"];
if (existsSync(envPath)) {
execArgv.push(`--env-file=${envPath}`);
}
export default defineConfig({
resolve: {
alias: {
"rusty-motors-protocol": resolve(projectRoot, "packages/protocol"),
"@rustymotors/binary": resolve(projectRoot, "libs/@rustymotors/binary"),
},
},
test: {
server: {
deps: {
inline: ["rusty-motors-protocol", "@rustymotors/binary"],
},
},
poolOptions: {
forks: {
// Only include --env-file if .env exists (for CI compatibility)
execArgv,
}
},
coverage: {
enabled: true,
all: true,
exclude: [
"src/**/*.spec.ts",
"src/**/*.test.ts",
"bin/**/*.ts",
"interfaces",
"vite.config.ts",
"instrument.mjs",
"commitlint.config.js",
"packages/pklib-ts",
"**/coverage/**",
...coverageConfigDefaults.exclude,
],
reporter: ["lcov", "text-summary"],
},
exclude: [
"packages/pklib-ts",
"**/session/sessionReplay.test.ts",
"**/session/integration.example.test.ts",
"**/session/SessionRecorder.test.ts",
...configDefaults.exclude
],
reporters: ["junit", "dot", "hanging-process"],
outputFile: "mcos.junit.xml",
pool: "forks",
},
});