-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.ts
More file actions
53 lines (51 loc) · 1.37 KB
/
vite.config.ts
File metadata and controls
53 lines (51 loc) · 1.37 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
/**
* Purpose: Vite and Vitest runtime configuration for local development, proxying, build output, and tests.
*/
import react from "@vitejs/plugin-react";
import path from "node:path";
import { loadEnv } from "vite";
import { defineConfig } from "vitest/config";
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), "");
const flightSearchTarget = env.VITE_FLIGHT_SEARCH ?? "http://localhost:8080";
const tracingTarget = env.VITE_OPENTELEMETRY_ENDPOINT ?? "http://localhost:55681";
return {
plugins: [react()],
resolve: {
alias: {
"@": path.resolve(__dirname, "src"),
},
},
build: {
outDir: "dist",
},
server: {
proxy: {
"/flightsearchapi": {
target: flightSearchTarget,
changeOrigin: true,
},
"/tracingapi": {
target: tracingTarget,
changeOrigin: true,
rewrite: (path) => path.replace(/^\/tracingapi/, ""),
},
},
},
test: {
globals: true,
environment: "jsdom",
setupFiles: ["./src/setupTests.ts"],
coverage: {
provider: "v8",
reporter: ["text", "lcov", "html"],
thresholds: {
statements: 80,
branches: 80,
functions: 80,
lines: 80,
},
},
},
};
});