Files
plast-track/simulator-ui/vite.config.ts
2026-06-17 01:06:21 +01:00

20 lines
455 B
TypeScript

import { defineConfig, loadEnv } from "vite";
import react from "@vitejs/plugin-react-swc";
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), "");
const allowedHosts = (env.VITE_ALLOWED_HOSTS ?? "localhost,127.0.0.1")
.split(",")
.map((host) => host.trim())
.filter(Boolean);
return {
plugins: [react()],
server: {
host: "0.0.0.0",
port: 5174,
allowedHosts,
},
};
});