-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathvite.config.ts
38 lines (37 loc) · 1.05 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
import { defineConfig, loadEnv } from "vite";
import react from "@vitejs/plugin-react";
import path from "path";
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), "");
return {
base: "/subdub-editor/",
plugins: [react()],
server: {
port: 3000,
host: "0.0.0.0",
proxy: {
"/api": "http://localhost:3000",
},
headers: {
"Cross-Origin-Opener-Policy": "same-origin",
"Cross-Origin-Embedder-Policy": "require-corp",
},
},
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
define: {
"process.env.DUBBING_API_BASE_URL": JSON.stringify(
env.DUBBING_API_BASE_URL
),
"process.env.TRANSCRIPTION_API_BASE_URL": JSON.stringify(
env.TRANSCRIPTION_API_BASE_URL
),
"process.env.MATXA_API_BASE_URL": JSON.stringify(env.MATXA_API_BASE_URL),
"process.env.APP_MODE": JSON.stringify(env.APP_MODE),
"process.env.APP_LANGUAGE": JSON.stringify(env.APP_LANGUAGE),
},
};
});