Skip to content

Commit

Permalink
feat: Expose parent env require on require.fromParentEnvironment
Browse files Browse the repository at this point in the history
  • Loading branch information
medikoo committed Nov 29, 2019
1 parent a53f9a9 commit fcfe2c1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/webmake.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,11 @@
return resolve(scope, tree, path, fullPath, state, id);
};
getRequire = function (scope, tree, id) {
return function (path) {
var localRequire = function (path) {
return wmRequire(scope, [].concat(tree), path, id);
};
if (envRequire) localRequire.fromParentEnvironment = envRequire;
return localRequire
};
return getRequire(modules, [], '');
})
})

0 comments on commit fcfe2c1

Please sign in to comment.