From 8438bc9c384bd74f97dd92250183b575fde4fba0 Mon Sep 17 00:00:00 2001 From: Yuri Becker Date: Fri, 11 Oct 2024 23:08:19 +0200 Subject: [PATCH] Fix vite.config.js not reading DEV_PORT --- frontend/vite.config.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/vite.config.js b/frontend/vite.config.js index 51abd248c..11275f64c 100644 --- a/frontend/vite.config.js +++ b/frontend/vite.config.js @@ -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 {