Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Commit

Permalink
inflate-shrinkwrap: Stop calling addBundle on locked deps
Browse files Browse the repository at this point in the history
PR-URL: #17508
Credit: @iarna
Reviewed-By: @zkat
  • Loading branch information
iarna authored and zkat committed Jul 5, 2017
1 parent 9d1e3b6 commit 3b4681b
Showing 1 changed file with 20 additions and 26 deletions.
46 changes: 20 additions & 26 deletions lib/install/inflate-shrinkwrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,34 +114,28 @@ function makeFakeChild (name, topPath, tree, sw, requested) {
_where: topPath,
_args: [[requested.toString(), topPath]]
}
let bundleAdded = BB.resolve()
if (Object.keys(sw.dependencies || {}).some((d) => {
return sw.dependencies[d].bundled
})) {
pkg.bundleDependencies = []
bundleAdded = addBundled(pkg)
}
return bundleAdded.then(() => {
const child = createChild({
package: pkg,
loaded: true,
parent: tree,
children: pkg._bundled || [],
fromShrinkwrap: true,
fakeChild: sw,
fromBundle: sw.bundled ? tree.fromBundle || tree : null,
path: childPath(tree.path, pkg),
realpath: childPath(tree.realpath, pkg),
location: tree.location + '/' + pkg.name,
isInLink: tree.isLink
})
tree.children.push(child)
if (pkg._bundled) {
delete pkg._bundled
inflateBundled(child, child, child.children)

if (!sw.bundled) {
const bundleDependencies = Object.keys(sw.dependencies || {}).filter((d) => sw.dependencies[d].bundled)
if (bundleDependencies.length === 0) {
pkg.bundleDependencies = bundleDependencies
}
return child
}
const child = createChild({
package: pkg,
loaded: true,
parent: tree,
children: pkg._bundled || [],
fromShrinkwrap: true,
fakeChild: sw,
fromBundle: sw.bundled ? tree.fromBundle || tree : null,
path: childPath(tree.path, pkg),
realpath: childPath(tree.realpath, pkg),
location: tree.location + '/' + pkg.name,
isInLink: tree.isLink
})
tree.children.push(child)
return child
}

function adaptResolved (requested, resolved) {
Expand Down

0 comments on commit 3b4681b

Please sign in to comment.