File tree 2 files changed +10
-6
lines changed 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import {
13
13
isObject ,
14
14
normalizePath ,
15
15
fsPathFromId ,
16
+ ensureVolumeInPath ,
16
17
resolveFrom ,
17
18
isDataUrl ,
18
19
cleanUrl ,
@@ -262,7 +263,7 @@ function tryResolveFile(
262
263
if ( index ) return normalizePath ( index ) + query
263
264
}
264
265
} else {
265
- return normalizePath ( file ) + query
266
+ return normalizePath ( ensureVolumeInPath ( file ) ) + query
266
267
}
267
268
}
268
269
}
Original file line number Diff line number Diff line change @@ -60,15 +60,18 @@ const isWindows = os.platform() === 'win32'
60
60
const VOLUME_RE = / ^ [ A - Z ] : / i
61
61
62
62
export function normalizePath ( id : string ) : string {
63
- if ( isWindows ) {
64
- return path . posix . normalize ( slash ( id . replace ( VOLUME_RE , '' ) ) )
65
- }
66
- return path . posix . normalize ( id )
63
+ return path . posix . normalize ( isWindows ? slash ( id ) : id )
67
64
}
68
65
69
66
export function fsPathFromId ( id : string ) : string {
70
67
const fsPath = normalizePath ( id . slice ( FS_PREFIX . length ) )
71
- return fsPath . startsWith ( '/' ) ? fsPath : `/${ fsPath } `
68
+ return fsPath . startsWith ( '/' ) || fsPath . match ( VOLUME_RE )
69
+ ? fsPath
70
+ : `/${ fsPath } `
71
+ }
72
+
73
+ export function ensureVolumeInPath ( file : string ) : string {
74
+ return isWindows ? path . resolve ( file ) : file
72
75
}
73
76
74
77
export const queryRE = / \? .* $ /
You can’t perform that action at this time.
0 commit comments