import { existsSync } from "node:fs"; import { dirname, resolve } from "node:path"; // In dev (bun run src/index.ts), import.meta.dir is a real filesystem path. // In compiled binary (bun build --compile), it's a virtual path that doesn't exist. const devRoot = resolve(import.meta.dir, ".."); export const PROJECT_ROOT = existsSync(devRoot) ? devRoot : dirname(process.execPath);