import module from "module";
const require = module.createRequire(import.meta.url);
export function resolve(specifier, context, nextResolve) {
    const { overrideReact , hookPropertyMap  } = require(process.env.NEXT_YARN_PNP ? "./import-overrides" : "next/dist/server/import-overrides");
    // In case the environment variable is set after the module is loaded.
    overrideReact();
    const hookResolved = hookPropertyMap.get(specifier);
    if (hookResolved) {
        specifier = hookResolved;
    }
    if (specifier.endsWith("next/dist/bin/next")) {
        return {
            url: specifier,
            shortCircuit: true,
            format: "commonjs"
        };
    }
    return nextResolve(specifier, context);
}

//# sourceMappingURL=esm-loader.mjs.map