import react from "@vitejs/plugin-react"; import { defineConfig, loadEnv } from "vite"; // https://vitejs.dev/config/ export default defineConfig(({ mode }) => { // Load env file based on `mode` in the current directory. // Set the third parameter to '' to load all env regardless of the `VITE_` prefix. const env = loadEnv(mode, process.cwd(), ''); return { plugins: [react()], // Make Vite aware of the env variables define: { 'process.env': env }, // Enable CORS for development server: { cors: true, port: env.PORT ? Number(env.PORT) : 3000, allowedHosts: ['.localhost', 'lboulet.vm.vdi.s1.p.fti.net'] } } });