Don't try using path mapping for vscode.dev with local folder (#233139)

For #231098
This commit is contained in:
Matt Bierner
2024-11-05 19:44:48 -08:00
committed by GitHub
parent 159db3fe57
commit db1db1518d

View File

@@ -344,8 +344,13 @@ function createServerHost(
return path;
}
const isNm = looksLikeNodeModules(path) && !path.startsWith('/vscode-global-typings/');
// skip paths without .. or ./ or /. And things that look like node_modules
const isNm = looksLikeNodeModules(path)
&& !path.startsWith('/vscode-global-typings/')
// Handle the case where a local folder has been opened in VS Code
// In these cases we do not want to use the mapped node_module
&& !path.startsWith('/file/');
// skip paths without .. or ./ or /
if (!isNm && !path.match(/\.\.|\/\.|\.\//)) {
return path;
}