File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,15 @@ function _tryModuleResolve(
37
37
}
38
38
}
39
39
40
- function _resolve ( id : string , options : ResolveOptions = { } ) : string {
40
+ function _resolve ( id : string | URL , options : ResolveOptions = { } ) : string {
41
+ if ( typeof id !== "string" ) {
42
+ if ( id instanceof URL ) {
43
+ id = fileURLToPath ( id ) ;
44
+ } else {
45
+ throw new TypeError ( "input must be a `string` or `URL`" ) ;
46
+ }
47
+ }
48
+
41
49
// Skip if already has a protocol
42
50
if ( / ( n o d e | d a t a | h t t p | h t t p s ) : / . test ( id ) ) {
43
51
return id ;
@@ -49,7 +57,7 @@ function _resolve(id: string, options: ResolveOptions = {}): string {
49
57
}
50
58
51
59
// Enable fast path for file urls
52
- if ( id . startsWith ( "file:" ) ) {
60
+ if ( id . startsWith ( "file:// " ) ) {
53
61
id = fileURLToPath ( id ) ;
54
62
}
55
63
You can’t perform that action at this time.
0 commit comments