diff --git a/lib/_tsc.js b/lib/_tsc.js index b1286228d17f4..d06c7ff6caf0c 100644 --- a/lib/_tsc.js +++ b/lib/_tsc.js @@ -15067,7 +15067,7 @@ function tryGetModuleSpecifierFromDeclaration(node) { } } function shouldRewriteModuleSpecifier(specifier, compilerOptions) { - return !!compilerOptions.rewriteRelativeImportExtensions && pathIsRelative(specifier) && !isDeclarationFileName(specifier); + return !!compilerOptions.rewriteRelativeImportExtensions && pathIsRelative(specifier) && !isDeclarationFileName(specifier) && hasTSFileExtension(specifier); } function getExternalModuleName(node) { switch (node.kind) { diff --git a/lib/typescript.js b/lib/typescript.js index 1ca07e0bd08f9..366e30eeb7daa 100644 --- a/lib/typescript.js +++ b/lib/typescript.js @@ -18774,7 +18774,7 @@ function tryGetImportFromModuleSpecifier(node) { } } function shouldRewriteModuleSpecifier(specifier, compilerOptions) { - return !!compilerOptions.rewriteRelativeImportExtensions && pathIsRelative(specifier) && !isDeclarationFileName(specifier); + return !!compilerOptions.rewriteRelativeImportExtensions && pathIsRelative(specifier) && !isDeclarationFileName(specifier) && hasTSFileExtension(specifier); } function getExternalModuleName(node) { switch (node.kind) {