Fix vite.config.js not reading DEV_PORT

This commit is contained in:
Yuri Becker
2024-10-11 23:08:19 +02:00
parent 36c77d51c8
commit 8438bc9c38

View File

@@ -11,7 +11,11 @@ import { defineConfig, loadEnv } from "vite";
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
// Load ENV variables from the parent directory and the current directory.
const env = { ...loadEnv(mode, "../"), ...loadEnv(mode, "./") };
const envPrefixes = ["VITE", "DEV"];
const env = {
...loadEnv(mode, "../", envPrefixes),
...loadEnv(mode, "./", envPrefixes),
};
const backendPort = env.DEV_PORT ?? "5000";
return {