-
Notifications
You must be signed in to change notification settings - Fork 22
/
vite.config.ts
54 lines (52 loc) · 1.16 KB
/
vite.config.ts
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
/// <reference types="vitest" />
import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
import svgr from "vite-plugin-svgr";
import viteTsconfigPaths from "vite-tsconfig-paths";
const BACKEND_SERVER = "http://localhost:8000";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react(), viteTsconfigPaths(), svgr()],
build: {
outDir: "build",
rollupOptions: {
output: {
// see https://github.com/vitejs/vite/issues/11804#issuecomment-2009619365
chunkFileNames: "chunk-[hash].js",
},
},
},
resolve: {
alias: {
"@": "/src",
},
},
server: {
port: 3000,
proxy: {
"/api": {
target: BACKEND_SERVER,
changeOrigin: true,
secure: false,
},
},
},
test: {
globals: true,
environment: "jsdom",
setupFiles: ["./src/setupTests.ts"],
coverage: {
reporter: ["text", "html"],
all: true,
include: ["src"],
exclude: [
"src/setupTests.ts",
"**/*.test.ts",
"**/*.test.tsx",
"**/*.d.ts",
"src/testServer.ts",
"src/utils/test-utils.tsx",
],
},
},
});