// NOTE: We only capture these at register time, to ensure that we don't interfere with any other custom require hooks
oldJSLoader=Module._extensions[".js"];
oldMJSLoader=Module._extensions[".mjs"];
letnewLoader=function(mod,filename){
try{
returnoldJSLoader(mod,filename);
}catch(error){
if(error.code==="ERR_REQUIRE_ESM"){
// NOTE: We completely bypass the default internal loader, as we cannot patch the `type: module` check out of that. Please open a PR if you have a better solution!