Skip to content

Commit e28869d

Browse files
committed
Ensure that from tsc with --incremental sets source file version
Fixes microsoft#30588 and microsoft#30589
1 parent 684c531 commit e28869d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/compiler/watch.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ namespace ts {
275275
}
276276
}
277277

278-
export function setGetSourceFileAsHashVersioned(compilerHost: CompilerHost, host: ProgramHost<any>) {
278+
export function setGetSourceFileAsHashVersioned(compilerHost: CompilerHost, host: { createHash?(data: string): string; }) {
279279
const originalGetSourceFile = compilerHost.getSourceFile;
280280
const computeHash = host.createHash || generateDjb2Hash;
281281
compilerHost.getSourceFile = (...args) => {

src/tsc/tsc.ts

+1
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ namespace ts {
263263
const host = createCompilerHost(options);
264264
const currentDirectory = host.getCurrentDirectory();
265265
const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames());
266+
setGetSourceFileAsHashVersioned(host, sys);
266267
changeCompilerHostLikeToUseCache(host, fileName => toPath(fileName, currentDirectory, getCanonicalFileName));
267268
enableStatistics(options);
268269
const oldProgram = readBuilderProgram(options, path => host.readFile(path));

0 commit comments

Comments
 (0)