-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
44 lines (42 loc) · 1.1 KB
/
Copy pathvite.config.ts
File metadata and controls
44 lines (42 loc) · 1.1 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
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import tailwindcss from "@tailwindcss/vite";
import path from "path";
const API_PORT = process.env.ENSO_PORT || "3001";
const API_TARGET = `http://localhost:${API_PORT}`;
export default defineConfig({
plugins: [react(), tailwindcss()],
define: {
// Build-time config for APK auto-connect (set during ./setup APK build)
"__ENSO_DEFAULT_BACKEND__": JSON.stringify(process.env.ENSO_DEFAULT_BACKEND || ""),
"__ENSO_DEFAULT_TOKEN__": JSON.stringify(process.env.ENSO_DEFAULT_TOKEN || ""),
"__ENSO_DEFAULT_NAME__": JSON.stringify(process.env.ENSO_DEFAULT_NAME || ""),
},
resolve: {
alias: {
"@shared": path.resolve(__dirname, "shared"),
},
},
server: {
host: true,
allowedHosts: true,
proxy: {
"/ws": {
target: API_TARGET,
ws: true,
},
"/media": {
target: API_TARGET,
},
"/upload": {
target: API_TARGET,
},
"/demo": {
target: API_TARGET,
},
"/api": {
target: API_TARGET,
},
},
},
});