Skip to content

Commit 9ca3af0

Browse files
committed
fix(externals): normalize bare package name on windows
1 parent fe76856 commit 9ca3af0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎src/build/plugins/externals.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { ExternalsTraceOptions, TracedLayout } from "nf3";
44

55
import { pathToFileURL } from "node:url";
66
import { builtinModules, createRequire } from "node:module";
7-
import { dirname, isAbsolute, join, relative } from "pathe";
7+
import { dirname, isAbsolute, join, normalize, relative } from "pathe";
88
import MagicString from "magic-string";
99
import { resolveModulePath } from "exsolve";
1010
import consola from "consola";
@@ -442,7 +442,7 @@ function guessSubpath(path: string, conditions: string[]): string | undefined {
442442
if (e.fsPath === subpath) {
443443
// The "." export is the package itself: `join(name, "./")` would give
444444
// `name/`, which is not a valid package subpath.
445-
return e.subpath === "./" ? name : join(name, e.subpath);
445+
return e.subpath === "./" ? normalize(name) : join(name, e.subpath);
446446
}
447447
if (e.fsPath.includes("*")) {
448448
const fsPathRe = new RegExp(

0 commit comments

Comments
 (0)