fix: honor managed Vite profile environment

This commit is contained in:
2026-08-05 00:35:21 +00:00
parent 76cf5cd597
commit 58f5e1102f
2 changed files with 24 additions and 1 deletions
+9 -1
View File
@@ -23,9 +23,17 @@ const resolvePreviewAllowedHosts = (value: string | undefined): true | string[]
return hosts;
};
export const mergeViteEnv = (
fileEnv: Record<string, string>,
runtimeEnv: NodeJS.ProcessEnv
): Record<string, string | undefined> => ({
...fileEnv,
...runtimeEnv,
});
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '');
const env = mergeViteEnv(loadEnv(mode, process.cwd(), ''), process.env);
return {
base: normalizeBasePath(env.VITE_APP_BASE_PATH),
plugins: [vue(), tailwindcss()],