Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1822,6 +1822,14 @@ export class Util {
return thePath;
}

//handle `virtual:/` paths specially - just normalize slashes, don't use path.normalize which would mangle the `virtual:` prefix
if (/^virtual:[\/\\]/i.test(thePath)) {
// Strip the `virtual:` prefix, normalize slashes, then re-add the prefix
thePath = 'virtual:/' + thePath.slice(8).replace(/^[\/\\]+/, '').replace(/[\/\\]+/g, '/').toLowerCase();
this.standardizePathCache.set(originalPath, thePath);
return thePath;
}

//windows path.normalize will convert all slashes to backslashes and remove duplicates
if (this.isWindows) {
thePath = path.win32.normalize(thePath);
Expand Down