import { getPackageJsonPath } from "./getPackageJsonPath.mjs";
import { __require$1 } from "../_virtual/rolldown_runtime.mjs";
import { createRequire } from "node:module";

//#region ../@intlayer/cli/dist/esm/core/dist/esm/config/dist/esm/utils/ESMxCJSHelpers.mjs
const isESModule = typeof import.meta.url === "string";
/**
* Require relative to the user project
*
* Note: Can resolve package that are installed in the user project, ex `'intlayer'`
*/
const getProjectRequire = (startDir) => {
	const { packageJsonPath } = getPackageJsonPath(startDir);
	return createRequire(packageJsonPath);
};
/**
* Require relative to the @intlayer/config package
*
* Note: Can resolve package that are installed in the config package, ex `'@intlayer/types'`
*/
const configESMxCJSRequire = isESModule ? createRequire(import.meta.url) : __require$1;

//#endregion
export { configESMxCJSRequire, getProjectRequire };
//# sourceMappingURL=ESMxCJSHelpers.mjs.map