Skip to content

Commit

Permalink
Update config.packages on location rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
cdebost committed Feb 7, 2019
1 parent 7888981 commit aaff8e9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion require.js
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,14 @@
loadingPackages[location] = Require.loadPackageDescription(dependency, config)
.then(function (packageDescription) {
// loadPackageDescription may have mutated dependency.location
return Require.injectLoadedPackageDescription(dependency.location, packageDescription, config);
var pkg = Require.injectLoadedPackageDescription(dependency.location, packageDescription, config);
var rewriteLocation = location !== dependency.location;
if (rewriteLocation) {
loadingPackages[dependency.location] = loadingPackages[location];
// config.packages[dependency.location] is set by injectLoadedPackageDescription
config.packages[location] = config.packages[dependency.location];
}
return pkg;
});
}
return loadingPackages[location];
Expand Down

0 comments on commit aaff8e9

Please sign in to comment.