-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
41 lines (37 loc) · 987 Bytes
/
vite.config.js
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
import { defineConfig, loadEnv } from "vite";
import react from "@vitejs/plugin-react";
export default defineConfig(({ mode }) => {
// Load environment variables based on the mode
const env = loadEnv(mode, process.cwd(), "");
return {
server: {
proxy: {
"/ws": {
target: "http://localhost:8080",
secure: false,
changeOrigin: true,
ws: true, // Enable WebSocket proxying
},
},
},
plugins: [react()],
define: {
"process.env.OCTOAI_TOKEN": JSON.stringify(env.OCTOAI_TOKEN),
// By default, Vite doesn't include shims for NodeJS/
// necessary for segment analytics lib to work
global: {},
},
};
});
// export default defineConfig({
// server: {
// proxy: {
// "/ws": {
// target: "http://localhost:8080",
// changeOrigin: true,
// ws: true, // Enable WebSocket proxying
// },
// },
// },
// plugins: [react()],
// });