Skip to content

Commit cd7191c

Browse files
Kevin SmithMylesBorins
authored andcommitted
module: Add node_modules paths lookup to import.meta.require
1 parent 4ecebf4 commit cd7191c

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

lib/internal/process/esm_loader.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,8 @@ function initializeImportMetaObject(wrap, meta) {
4242
const path = getPathFromURL(url);
4343
const mod = new Module(path, null);
4444
mod.filename = path;
45+
mod.paths = Module._nodeModulePaths(path);
4546
req = makeRequireFunction(mod).bind(null);
46-
47-
// remove properties that don't affect ESM loading
48-
// delete req.cache;
49-
// delete req.extensions;
50-
// delete req.main;
51-
// delete req.resolve.paths;
5247
return req;
5348
}
5449
});

0 commit comments

Comments
 (0)