import { existsSync } from "node:fs";
import dotenv from "dotenv";

//#region ../@intlayer/chokidar/dist/esm/remote-dictionaries-entry/dist/esm/config/dist/esm/loadEnvFile.mjs
const DEFAULT_ENV = "development";
const loadEnvFile = (options) => {
	const env = options?.env ?? DEFAULT_ENV;
	const envFiles = options?.envFile ? [options.envFile] : [
		`.env.${env}.local`,
		`.env.${env}`,
		".env.local",
		".env"
	];
	const result = {};
	dotenv.config({
		path: envFiles,
		processEnv: result
	});
	return result;
};

//#endregion
export { loadEnvFile };
//# sourceMappingURL=loadEnvFile.mjs.map