35 lines
796 B
TypeScript
35 lines
796 B
TypeScript
import { reactRouter } from "@react-router/dev/vite";
|
|
import tailwindcss from "@tailwindcss/vite";
|
|
import { defineConfig, loadEnv } from "vite";
|
|
import path from "node:path";
|
|
|
|
export default defineConfig(({ mode }) => {
|
|
const env = loadEnv(mode, __dirname, "");
|
|
const gatewayUrl = env.VITE_GATEWAY_URL || "http://127.0.0.1:8890";
|
|
|
|
return {
|
|
base: '/',
|
|
plugins: [reactRouter(), tailwindcss()],
|
|
resolve: {
|
|
alias: {
|
|
"~": path.resolve(__dirname, "./app"),
|
|
},
|
|
},
|
|
server: {
|
|
host: "0.0.0.0",
|
|
port: 5173,
|
|
proxy: {
|
|
"/api": {
|
|
target: gatewayUrl,
|
|
changeOrigin: true,
|
|
},
|
|
"/jupyter": {
|
|
target: gatewayUrl,
|
|
changeOrigin: true,
|
|
ws: true,
|
|
},
|
|
},
|
|
},
|
|
};
|
|
});
|