From 4aff5c74643483761b0aa23c29b68fb0dc217372 Mon Sep 17 00:00:00 2001 From: "Mark R. Florkowski" Date: Tue, 23 Jan 2024 10:50:42 -0800 Subject: [PATCH] check MODE variable --- src/flags.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/flags.ts b/src/flags.ts index df17783..464b8b5 100644 --- a/src/flags.ts +++ b/src/flags.ts @@ -22,11 +22,11 @@ export const isDebug = toBoolean(env.DEBUG); /** Detect if `NODE_ENV` environment variable is `test` */ export const isTest = nodeENV === "test" || toBoolean(env.TEST); -/** Detect if `NODE_ENV` environment variable is `production` */ -export const isProduction = nodeENV === "production"; +/** Detect if `NODE_ENV` or `MODE` environment variable is `production` */ +export const isProduction = nodeENV === "production" || env.MODE === "production"; -/** Detect if `NODE_ENV` environment variable is `dev` or `development` */ -export const isDevelopment = nodeENV === "dev" || nodeENV === "development"; +/** Detect if `NODE_ENV` environment variable is `dev` or `development`, or if `MODE` environment variable is `development` */ +export const isDevelopment = nodeENV === "dev" || nodeENV === "development" || env.MODE === "development"; /** Detect if MINIMAL environment variable is set, running in CI or test or TTY is unavailable */ export const isMinimal = toBoolean(env.MINIMAL) || isCI || isTest || !hasTTY;