Skip to content

Commit 4d2e6b8

Browse files
committed
fix: externals windows paths
1 parent ab30f36 commit 4d2e6b8

3 files changed

Lines changed: 9 additions & 8 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
"mime": "^4.1.0",
129129
"miniflare": "^4.20251202.1",
130130
"mlly": "^1.8.0",
131-
"nf3": "^0.3.0",
131+
"nf3": "^0.3.1",
132132
"nypm": "^0.6.2",
133133
"obuild": "^0.4.7",
134134
"pathe": "^2.0.3",

pnpm-lock.yaml

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/build/plugins/externals.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,10 @@ export function externals(opts: ExternalsOptions): Plugin {
156156
// ---- Internal utils ----
157157

158158
const NODE_MODULES_RE =
159-
/^(?<dir>.+\/node_modules\/)(?<name>[^/@]+|@[^/]+\/[^/]+)(?:\/(?<subpath>.+))?$/;
159+
/^(?<dir>.+[\\/]node_modules[\\/])(?<name>[^@\\/]+|@[^\\/]+[\\/][^\\/]+)(?:[\\/](?<subpath>.+))?$/;
160160

161-
const IMPORT_RE = /^(?!\.)(?<name>[^/@]+|@[^/]+\/[^/]+)(?:\/(?<subpath>.+))?$/;
161+
const IMPORT_RE =
162+
/^(?!\.)(?<name>[^@/\\]+|@[^/\\]+[/\\][^/\\]+)(?:[/\\](?<subpath>.+))?$/;
162163

163164
function toImport(id: string): string | undefined {
164165
if (isAbsolute(id)) {

0 commit comments

Comments
 (0)