From a8f5182d2587a97f0b22b696410abde170c951bd Mon Sep 17 00:00:00 2001 From: alex8088 <244096523@qq.com> Date: Fri, 15 Dec 2023 22:14:58 +0800 Subject: [PATCH] perf: loadEnv api also needs to load shared env variables prefixed with VITE_ --- src/utils.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils.ts b/src/utils.ts index 810a0c1..e53be1a 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -38,14 +38,14 @@ export function toRelativePath(filename: string, importer: string): string { } /** - * Load `.env` files within the `envDir`(default: `process.cwd()`). - * By default, only env variables prefixed with `MAIN_VITE_`, `PRELOAD_VITE_` and + * Load `.env` files within the `envDir` (default: `process.cwd()`) . + * By default, only env variables prefixed with `VITE_`, `MAIN_VITE_`, `PRELOAD_VITE_` and * `RENDERER_VITE_` are loaded, unless `prefixes` is changed. */ export function loadEnv( mode: string, envDir: string = process.cwd(), - prefixes: string | string[] = ['MAIN_VITE_', 'PRELOAD_VITE_', 'RENDERER_VITE_'] + prefixes: string | string[] = ['VITE_', 'MAIN_VITE_', 'PRELOAD_VITE_', 'RENDERER_VITE_'] ): Record { return viteLoadEnv(mode, envDir, prefixes) }