tryGetModuleNameAsNodeModule: Ignore file extension (#24774)

This commit is contained in:
Andy
2018-06-07 15:45:03 -07:00
committed by GitHub
parent 5138b4744d
commit 3822e3e4ed
2 changed files with 2 additions and 9 deletions

View File

@@ -248,7 +248,7 @@ namespace ts.moduleSpecifiers {
const mainFileRelative = packageJsonContent.typings || packageJsonContent.types || packageJsonContent.main;
if (mainFileRelative) {
const mainExportFile = toPath(mainFileRelative, packageRootPath, getCanonicalFileName);
if (mainExportFile === getCanonicalFileName(path)) {
if (removeFileExtension(mainExportFile) === removeFileExtension(getCanonicalFileName(path))) {
return packageRootPath;
}
}