diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 83c54f4001e..cbc78cb9bf8 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -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 }; } diff --git a/src/testRunner/unittests/tsbuild.ts b/src/testRunner/unittests/tsbuild.ts index c2eb6d5aff0..c342aacf196 100644 --- a/src/testRunner/unittests/tsbuild.ts +++ b/src/testRunner/unittests/tsbuild.ts @@ -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); }; }