Skip to content

Commit c506172

Browse files
committed
Replace dotenv side-effect import with native loadEnvFile
1 parent 4ab8362 commit c506172

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/cli.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
import "dotenv/config";
1+
import { loadEnvFile } from "node:process";
2+
3+
// Native replacement for dotenv/config: load a cwd .env when present.
4+
try {
5+
loadEnvFile();
6+
} catch {
7+
// No .env in the working directory - nothing to load.
8+
}
29

310
import { existsSync, readFileSync } from "node:fs";
411
import { dirname, resolve } from "node:path";

0 commit comments

Comments
 (0)