Skip to content

Commit 3b1a62d

Browse files
avivkellerCopilot
andauthored
finally a good copilot suggestion
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Aviv Keller <me@aviv.sh>
1 parent c7f0f38 commit 3b1a62d

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

apps/site/next.constants.mjs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ export const VERCEL_ENV = process.env.VERCEL_ENV || undefined;
2323
*/
2424
export const VERCEL_REGION = process.env.VERCEL_REGION || undefined;
2525

26+
/**
27+
* This constant determines if the current environment is NOT a Vercel runtime environment.
28+
*
29+
* The logic is as follows:
30+
* - If we are NOT in a development environment (`!IS_DEV_ENV`) AND:
31+
* - Vercel environment variable (`VERCEL_ENV`) is defined but the Vercel region (`VERCEL_REGION`) is NOT defined, OR
32+
* - Vercel environment variable (`VERCEL_ENV`) is NOT defined at all.
33+
* This helps identify cases where the application is running outside of Vercel's runtime environment.
34+
*/
2635
export const IS_NOT_VERCEL_RUNTIME_ENV =
2736
(!IS_DEV_ENV && VERCEL_ENV && !VERCEL_REGION) || (!IS_DEV_ENV && !VERCEL_ENV);
2837

0 commit comments

Comments
 (0)