Make file generic to be .tsbuildinfo

This commit is contained in:
Sheetal Nandi 2019-01-30 09:41:43 -08:00
parent c8ff9ace0e
commit 00873f66c8
2 changed files with 4 additions and 4 deletions

View file

@ -1,6 +1,6 @@
namespace ts {
/*@internal*/
export const infoExtension = ".tsbundleinfo";
export const infoFile = ".tsbuildinfo";
const brackets = createBracketsMap();
const syntheticParent: TextRange = { pos: -1, end: -1 };
@ -46,7 +46,7 @@ namespace ts {
const sourceMapFilePath = jsFilePath && getSourceMapFilePath(jsFilePath, options);
const declarationFilePath = (forceDtsPaths || getEmitDeclarations(options)) ? removeFileExtension(outPath) + Extension.Dts : undefined;
const declarationMapPath = declarationFilePath && getAreDeclarationMapsEnabled(options) ? declarationFilePath + ".map" : undefined;
const bundleInfoPath = options.composite && jsFilePath ? (removeFileExtension(jsFilePath) + infoExtension) : undefined;
const bundleInfoPath = options.composite && jsFilePath ? combinePaths(getDirectoryPath(jsFilePath), infoFile) : undefined;
return { jsFilePath, sourceMapFilePath, declarationFilePath, declarationMapPath, bundleInfoPath };
}

View file

@ -506,7 +506,7 @@ export const b = new A();`);
if (path.startsWith("/src/")) {
actualReadFileMap.set(path, (actualReadFileMap.get(path) || 0) + 1);
}
if (withoutBundleInfo && fileExtensionIs(path, infoExtension)) {
if (withoutBundleInfo && getBaseFileName(path) === infoFile) {
return undefined;
}
return originalReadFile.call(host, path);
@ -514,7 +514,7 @@ export const b = new A();`);
if (withoutBundleInfo) {
const originalWriteFile = host.writeFile;
host.writeFile = (fileName, content, writeByteOrder) => {
return !fileExtensionIs(fileName, infoExtension) &&
return getBaseFileName(fileName) !== infoFile &&
originalWriteFile.call(host, fileName, content, writeByteOrder);
};
}