From 07dd3c295890824ef31e0f025d8b63df6c9ba6c6 Mon Sep 17 00:00:00 2001 From: Brandon Bayer Date: Mon, 6 Dec 2021 14:39:05 -0500 Subject: [PATCH] fix env file loading to default to development instead of production --- nextjs/packages/next-env/index.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/nextjs/packages/next-env/index.ts b/nextjs/packages/next-env/index.ts index 70e56bb9d3..9f89e7cfbd 100644 --- a/nextjs/packages/next-env/index.ts +++ b/nextjs/packages/next-env/index.ts @@ -77,13 +77,7 @@ export function loadEnvConfig( // environment values e.g. \$ENV_FILE_KEY if (combinedEnv) return { combinedEnv, loadedEnvFiles: cachedLoadedEnvFiles } - const appEnv = - process.env.APP_ENV || - (process.env.NODE_ENV === 'test' - ? 'test' - : dev - ? 'development' - : 'production') + const appEnv = process.env.APP_ENV ?? process.env.NODE_ENV ?? 'development' let dotenvFiles = [ `.env.${appEnv}.local`,