Return empty string instead to prevent exception downstream particularly in writeReferencePath

This commit is contained in:
Kanchalai Tanglertsampan
2017-02-22 15:42:22 -08:00
parent 746c45ccd9
commit 84b9ebd0d7

View File

@@ -2653,7 +2653,7 @@ namespace ts {
if (sourceFiles.length) {
const jsFilePath = options.outFile || options.out;
const sourceMapFilePath = getSourceMapFilePath(jsFilePath, options);
const declarationFilePath = options.declaration ? removeFileExtension(jsFilePath) + ".d.ts" : undefined;
const declarationFilePath = options.declaration ? removeFileExtension(jsFilePath) + ".d.ts" : "";
action({ jsFilePath, sourceMapFilePath, declarationFilePath }, createBundle(sourceFiles), emitOnlyDtsFiles);
}
}