Skip to content

Commit

Permalink
fix(builtin): fix linker common path reduction bug where reduced path…
Browse files Browse the repository at this point in the history
… conflicts with node_modules
  • Loading branch information
Greg Magolan authored and Alex Eagle committed May 29, 2020
1 parent 54cae78 commit 3b5350b
Show file tree
Hide file tree
Showing 3 changed files with 131 additions and 134 deletions.
9 changes: 0 additions & 9 deletions internal/linker/index.js
Expand Up @@ -247,15 +247,6 @@ function liftElement(element) {
if (link && allElementsAlignUnder(name, link, children)) {
return { name, link };
}
if (!link && allElementsAlign(name, children)) {
return {
name,
link: toParentLink(children[0].link),
};
}
if (children.length === 1 && !link) {
return children[0];
}
return element;
}
function toParentLink(link) {
Expand Down
15 changes: 0 additions & 15 deletions internal/linker/link_node_modules.ts
Expand Up @@ -409,21 +409,6 @@ function liftElement(element: LinkerTreeElement): LinkerTreeElement {
return {name, link};
}

// No link but all child elements have aligning links
// => the link can be lifted to here
if (!link && allElementsAlign(name, children)) {
return {
name,
link: toParentLink(children[0].link!),
};
}

// Only a single child and this element is just a directory (no link) => only need the child link
// Do this last only after trying to lift child links up
if (children.length === 1 && !link) {
return children[0];
}

return element;
}

Expand Down

0 comments on commit 3b5350b

Please sign in to comment.