When excluding same base name file from compilation, check for all supported javascript extensions instead of just .js

This commit is contained in:
Sheetal Nandi
2015-11-12 14:25:46 -08:00
parent 0b215404d1
commit 3bdad8a6b0

View File

@@ -517,7 +517,7 @@ namespace ts {
// If this is one of the output extension (which would be .d.ts and .js if we are allowing compilation of js files)
// do not include this file if we included .ts or .tsx file with same base name as it could be output of the earlier compilation
if (extension === ".d.ts" || (options.allowJs && extension === ".js")) {
if (extension === ".d.ts" || (options.allowJs && contains(supportedJavascriptExtensions, extension))) {
const baseName = fileName.substr(0, fileName.length - extension.length);
if (hasProperty(filesSeen, baseName + ".ts") || hasProperty(filesSeen, baseName + ".tsx")) {
continue;