Skip to content

Commit

Permalink
Only load package-lock.json when not mopped
Browse files Browse the repository at this point in the history
  • Loading branch information
cdebost committed Feb 7, 2019
1 parent aaff8e9 commit 0b5c1ae
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions require.js
Original file line number Diff line number Diff line change
Expand Up @@ -1035,13 +1035,17 @@
if (typeof packageDescription === "object") {
pkg = Require.injectLoadedPackageDescription(location, packageDescription, config);
} else {
pkg = Require.loadPackageLock(dependency, config)
.then(function (packageLock) {
if (packageLock) {
config.packageLock = packageLock;
}
return config.loadPackage(dependency);
});
if (config.preloaded) {
pkg = config.loadPackage(dependency);
} else {
pkg = Require.loadPackageLock(dependency, config)
.then(function (packageLock) {
if (packageLock) {
config.packageLock = packageLock;
}
return config.loadPackage(dependency);
});
}
}
if (typeof pkg.then === "function") {
pkg = pkg.then(function (pkg) {
Expand Down

0 comments on commit 0b5c1ae

Please sign in to comment.