mirror of
https://github.com/run-llama/llama-ui.git
synced 2026-08-25 09:19:49 -04:00
20 lines
524 B
TypeScript
20 lines
524 B
TypeScript
export function isDevelopment(): boolean {
|
|
try {
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
const env = (import.meta as any)?.env;
|
|
if (env?.DEV === true) return true;
|
|
if (env?.MODE === 'development') return true;
|
|
if (env?.PROD === false) return true;
|
|
} catch {
|
|
// no-op
|
|
}
|
|
|
|
// 3) Node / Next style envs
|
|
if (typeof process !== 'undefined' && process?.env?.NODE_ENV) {
|
|
return process.env.NODE_ENV !== 'production';
|
|
}
|
|
|
|
// 4) Fallback
|
|
return false;
|
|
}
|
|
|