minecluster/vite.config.ts

30 lines
742 B
TypeScript
Raw Permalink Normal View History

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-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,
"/healthz": backendUrl,
2023-03-05 14:16:12 -05:00
},
hmr: {
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/",
});
};