Skip to content

Commit 65d6029

Browse files
Greg Magolanalexeagle
authored andcommitted
fix(builtin): fix linker common path reduction bug where reduced path conflicts with node_modules
1 parent c9dd61e commit 65d6029

3 files changed

Lines changed: 131 additions & 134 deletions

File tree

internal/linker/index.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -277,15 +277,6 @@ function liftElement(element) {
277277
if (link && allElementsAlignUnder(name, link, children)) {
278278
return { name, link };
279279
}
280-
if (!link && allElementsAlign(name, children)) {
281-
return {
282-
name,
283-
link: toParentLink(children[0].link),
284-
};
285-
}
286-
if (children.length === 1 && !link) {
287-
return children[0];
288-
}
289280
return element;
290281
}
291282
function toParentLink(link) {

internal/linker/link_node_modules.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -439,21 +439,6 @@ function liftElement(element: LinkerTreeElement): LinkerTreeElement {
439439
return {name, link};
440440
}
441441

442-
// No link but all child elements have aligning links
443-
// => the link can be lifted to here
444-
if (!link && allElementsAlign(name, children)) {
445-
return {
446-
name,
447-
link: toParentLink(children[0].link!),
448-
};
449-
}
450-
451-
// Only a single child and this element is just a directory (no link) => only need the child link
452-
// Do this last only after trying to lift child links up
453-
if (children.length === 1 && !link) {
454-
return children[0];
455-
}
456-
457442
return element;
458443
}
459444

0 commit comments

Comments
 (0)