Skip to content

Commit

Permalink
fix(externals): avoid recursive package links
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Jan 20, 2023
1 parent 456f82a commit b77735e
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/rollup/plugins/externals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,12 +325,15 @@ export function externals(opts: NodeExternalsOptions): Plugin {
const parentPkgs = [
...new Set(
versionFiles.flatMap((file) =>
file.parents.flatMap(
(parentPath) =>
tracedFiles[parentPath].pkgName +
"@" +
tracedFiles[parentPath].pkgVersion
)
file.parents
.map((parentPath) => {
const parentFile = tracedFiles[parentPath];
if (parentFile.pkgName === pkg.name) {
return null;
}
return `${parentFile.pkgName}@${parentFile.pkgVersion}`;
})
.filter(Boolean)
)
),
];
Expand Down

0 comments on commit b77735e

Please sign in to comment.