From cd7191cac19f85e150a3a509f6173e1f1f5bef1d Mon Sep 17 00:00:00 2001 From: Kevin Smith Date: Sun, 1 Jul 2018 23:25:53 -0700 Subject: [PATCH] module: Add node_modules paths lookup to import.meta.require --- lib/internal/process/esm_loader.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/internal/process/esm_loader.js b/lib/internal/process/esm_loader.js index dbf6ac70da0d3d..cfae050d8c37be 100644 --- a/lib/internal/process/esm_loader.js +++ b/lib/internal/process/esm_loader.js @@ -42,13 +42,8 @@ function initializeImportMetaObject(wrap, meta) { const path = getPathFromURL(url); const mod = new Module(path, null); mod.filename = path; + mod.paths = Module._nodeModulePaths(path); req = makeRequireFunction(mod).bind(null); - - // remove properties that don't affect ESM loading - // delete req.cache; - // delete req.extensions; - // delete req.main; - // delete req.resolve.paths; return req; } });