Files
klz-cables.com/lib/load-env.ts
Marc Mintel d6c1d6bae6
Some checks failed
Build & Deploy KLZ Cables / build-and-deploy (push) Failing after 4m2s
env
2026-01-28 15:06:21 +01:00

11 lines
349 B
TypeScript

import dotenv from 'dotenv';
import path from 'path';
/**
* Loads environment variables from .env file in development.
* This must be called before any other module that uses environment variables.
*/
if (typeof window === 'undefined' && process.env.NODE_ENV !== 'production') {
dotenv.config({ path: path.resolve(process.cwd(), '.env') });
}