diff --git a/src/resolve.ts b/src/resolve.ts index bd505d7..b6b7be8 100644 --- a/src/resolve.ts +++ b/src/resolve.ts @@ -48,7 +48,12 @@ function _resolve(id: string, options: ResolveOptions = {}): string { return "node:" + id; } - // Skip resolve for absolute paths + // Enable fast path for file urls + if (id.startsWith("file:")) { + id = fileURLToPath(id); + } + + // Skip resolve for absolute paths (fast path) if (isAbsolute(id)) { try { const stat = statSync(id);