Skip to content

Commit d4db061

Browse files
committed
fixed typescript errro
1 parent 0f16a77 commit d4db061

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

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

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,21 @@ async function linkExternal(external: CollectedExternal, resolveDir: string, log
4949
if (external.name.startsWith("@")) {
5050
// Get the scope part (e.g., '@huggingface')
5151
const scopeDir = external.name.split("/")[0];
52-
const scopePath = join(destinationPath, scopeDir);
5352

54-
logger.debug("[externals] Ensure scope directory exists", {
55-
scopeDir,
56-
scopePath,
57-
});
53+
if (scopeDir) {
54+
const scopePath = join(destinationPath, scopeDir);
55+
56+
logger.debug("[externals] Ensure scope directory exists", {
57+
scopeDir,
58+
scopePath,
59+
});
5860

59-
await mkdir(scopePath, { recursive: true });
61+
await mkdir(scopePath, { recursive: true });
62+
} else {
63+
logger.debug("[externals] Unable to get the scope directory", {
64+
external,
65+
});
66+
}
6067
}
6168

6269
const symbolicLinkPath = join(destinationPath, external.name);

0 commit comments

Comments
 (0)