-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
vite.config.ts
77 lines (75 loc) · 1.74 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/// <reference types="vitest" />
import path, { resolve } from "path";
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react-swc";
import monacoEditorPlugin from "vite-plugin-monaco-editor";
const proxyHost = process.env.PROXY_HOST || "localhost:5000";
// https://vitejs.dev/config/
export default defineConfig({
define: {
"import.meta.vitest": "undefined",
},
server: {
proxy: {
"/api": {
target: `http:https://${proxyHost}`,
ws: true,
},
"/vod": {
target: `http:https://${proxyHost}`,
},
"/clips": {
target: `http:https://${proxyHost}`,
},
"/exports": {
target: `http:https://${proxyHost}`,
},
"/ws": {
target: `ws:https://${proxyHost}`,
ws: true,
},
"/live": {
target: `ws:https://${proxyHost}`,
changeOrigin: true,
ws: true,
},
},
},
build: {
rollupOptions: {
input: {
main: resolve(__dirname, "index.html"),
login: resolve(__dirname, "login.html"),
},
},
},
plugins: [
react(),
monacoEditorPlugin.default({
customWorkers: [{ label: "yaml", entry: "monaco-yaml/yaml.worker" }],
languageWorkers: ["editorWorkerService"], // we don't use any of the default languages
}),
],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
test: {
environment: "jsdom",
alias: {
"testing-library": path.resolve(
__dirname,
"./__test__/testing-library.js",
),
},
setupFiles: ["./__test__/test-setup.ts"],
includeSource: ["src/**/*.{js,jsx,ts,tsx}"],
coverage: {
reporter: ["text-summary", "text"],
},
mockReset: true,
restoreMocks: true,
globals: true,
},
});