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 alexeagle committed May 27, 2020
1 parent c9dd61e commit 65d6029
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
Original file line number Diff line number Diff line change
Expand Up @@ -277,15 +277,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
Original file line number Diff line number Diff line change
Expand Up @@ -439,21 +439,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
Loading

0 comments on commit 65d6029

Please sign in to comment.