mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-11-18 20:11:14 +00:00
Handle more places where package direcroy is converted to canonical file path (#50740)
* Add test for node16 resolution with package json lookup making casing incorrect * Handle more places where package direcroy is converted to canonical file path
This commit is contained in:
1 parent
f5f2923c7d
commit
6b890f93c4
13 files changed
+219
-68
No files matched your search
@@ -1378,7 +1378,7 @@ namespace ts.server {
|
||||
const packageDirectory = fileName.substring(0, nodeModulesPathParts.packageRootIndex);
|
||||
const packageJsonCache = project.getModuleResolutionCache()?.getPackageJsonInfoCache();
|
||||
const compilerOptions = project.getCompilationSettings();
|
||||
const packageJson = getPackageScopeForPath(project.toPath(packageDirectory + "/package.json"), getTemporaryModuleResolutionState(packageJsonCache, project, compilerOptions));
|
||||
const packageJson = getPackageScopeForPath(getNormalizedAbsolutePath(packageDirectory + "/package.json", project.getCurrentDirectory()), getTemporaryModuleResolutionState(packageJsonCache, project, compilerOptions));
|
||||
if (!packageJson) return undefined;
|
||||
// Use fake options instead of actual compiler options to avoid following export map if the project uses node16 or nodenext -
|
||||
// Mapping from an export map entry across packages is out of scope for now. Returned entrypoints will only be what can be
|
||||
|
||||
Reference in new issue
Block a user