import { config } from "dotenv"; import { fileURLToPath } from "node:url"; import { dirname, join } from "node:path"; // Side-effect-only module: populates process.env from the repo-root .env // file. Must be imported before ./env.js anywhere in the import graph — in // Docker this is a no-op since docker-compose's env_file already injects the // variables directly, but plain `node dist/index.js` / `tsx src/index.ts` // otherwise never reads .env at all. const __dirname = dirname(fileURLToPath(import.meta.url)); config({ path: join(__dirname, "..", "..", ".env") });