Skip to content

Commit 0f16a77

Browse files
committed
Support scopes packages in externals when found in a transitive dep
1 parent f3e4597 commit 0f16a77

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

packages/cli-v3/src/build/externals.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,20 @@ async function linkExternal(external: CollectedExternal, resolveDir: string, log
4545
external,
4646
});
4747

48+
// For scoped packages, we need to ensure the scope directory exists
49+
if (external.name.startsWith("@")) {
50+
// Get the scope part (e.g., '@huggingface')
51+
const scopeDir = external.name.split("/")[0];
52+
const scopePath = join(destinationPath, scopeDir);
53+
54+
logger.debug("[externals] Ensure scope directory exists", {
55+
scopeDir,
56+
scopePath,
57+
});
58+
59+
await mkdir(scopePath, { recursive: true });
60+
}
61+
4862
const symbolicLinkPath = join(destinationPath, external.name);
4963

5064
// Make sure the symbolic link does not exist

0 commit comments

Comments
 (0)