Make explorer env loading workspace-safe

This commit is contained in:
Codex Bot
2026-03-24 01:01:45 +01:00
parent e2c6f000c3
commit f8c0e84a40
5 changed files with 10 additions and 7 deletions

View File

@@ -4,10 +4,6 @@
"private": true,
"type": "module",
"main": "./dist/index.js",
"exports": {
".": "./dist/index.js",
"./load-env": "./dist/load-env.js"
},
"types": "./dist/index.d.ts",
"scripts": {
"build": "tsc -p tsconfig.json"

View File

@@ -1,9 +0,0 @@
import path from "node:path";
import { fileURLToPath } from "node:url";
import dotenv from "dotenv";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const repoRoot = path.resolve(__dirname, "../../../");
// Workspace commands run from apps/*, so load the root-level .env explicitly.
dotenv.config({ path: path.join(repoRoot, ".env") });