Skip to content

Commit

Permalink
Bind viaId on require.lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
kriskowal authored and cdebost committed Jan 30, 2019
1 parent 3ad4a40 commit c23cf63
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions common.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ Require.makeRequire = function (config) {

// Asynchronous "require.async()" which ensures async executation
// (even with synchronous loaders)
require.async = function(id) {
require.async = function (id) {
var topId = resolve(id, viaId);
var module = getModuleDescriptor(id);
return deepLoad(topId, viaId)
Expand All @@ -369,13 +369,16 @@ Require.makeRequire = function (config) {
});
};

require.lookup = function (id) {
return lookup(id, viaId);
};

require.resolve = function (id) {
return normalize(resolve(id, viaId));
};

require.getModule = getModuleDescriptor; // XXX deprecated, use:
require.getModuleDescriptor = getModuleDescriptor;
require.lookup = lookup;
require.load = load;
require.deepLoad = deepLoad;

Expand Down

0 comments on commit c23cf63

Please sign in to comment.