mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 21:06:50 -05:00
Try file if matched pattern specifies the extension instead of all the time (#42246)
* Test case for path mapping with extension * Try file if matched pattern specifies the extension instead of all the time Fixes #39743
This commit is contained in:
@@ -1377,7 +1377,7 @@ namespace ts {
|
||||
trace(state.host, Diagnostics.Trying_substitution_0_candidate_module_location_Colon_1, subst, path);
|
||||
}
|
||||
// A path mapping may have an extension, in contrast to an import, which should omit it.
|
||||
const extension = tryGetExtensionFromPath(candidate);
|
||||
const extension = tryGetExtensionFromPath(subst);
|
||||
if (extension !== undefined) {
|
||||
const path = tryFile(candidate, onlyRecordFailures, state);
|
||||
if (path !== undefined) {
|
||||
|
||||
Reference in New Issue
Block a user