2023-03-05 14:16:12 -05:00
|
|
|
import { defineConfig } from "vite";
|
|
|
|
import react from "@vitejs/plugin-react";
|
2024-04-06 20:38:10 -06:00
|
|
|
import tsconfigPaths from "vite-tsconfig-paths";
|
2023-03-05 14:16:12 -05:00
|
|
|
|
|
|
|
const { MCL_VITE_BACKEND_URL, MCL_VITE_DEV_PORT } = process.env;
|
|
|
|
const backendUrl = MCL_VITE_BACKEND_URL ?? "http://localhost:52000";
|
|
|
|
const vitePort = MCL_VITE_DEV_PORT ?? 52025;
|
2023-08-21 20:49:38 +00:00
|
|
|
|
2023-03-05 14:16:12 -05:00
|
|
|
export default () => {
|
|
|
|
return defineConfig({
|
2024-04-06 20:38:10 -06:00
|
|
|
plugins: [react(), tsconfigPaths()],
|
2023-03-05 14:16:12 -05:00
|
|
|
server: {
|
|
|
|
host: "0.0.0.0",
|
2024-04-06 20:38:10 -06:00
|
|
|
port: Number(vitePort),
|
2023-03-05 14:16:12 -05:00
|
|
|
proxy: {
|
|
|
|
"/api": backendUrl,
|
|
|
|
"/socket.io": backendUrl,
|
2023-12-20 03:20:04 +00:00
|
|
|
"/healthz": backendUrl,
|
2023-03-05 14:16:12 -05:00
|
|
|
},
|
|
|
|
hmr: {
|
2023-03-15 15:20:08 +00:00
|
|
|
protocol: process.env.MCL_VITE_DEV_PROTOCOL,
|
2023-03-05 14:16:12 -05:00
|
|
|
},
|
|
|
|
},
|
|
|
|
build: {
|
2024-04-06 20:38:10 -06:00
|
|
|
outDir: "./build/vite",
|
2023-03-05 14:16:12 -05:00
|
|
|
},
|
|
|
|
base: "/mcl/",
|
|
|
|
});
|
|
|
|
};
|