Open perbergland opened 3 years ago
I cant repro this with typescript@next
c:\temp\typescript-incremental-watch-bug>node compileTypescript.js
Typescript 4.2.0-dev.20210129
reading buildinfo from output/buildfile.tsbuildinfo
emitAllAffectedFiles invoked
emitting output/out/Hello.js.map for c:/temp/typescript-incremental-watch-bug/src/Hello.tsx
emitting output/out/Hello.js for c:/temp/typescript-incremental-watch-bug/src/Hello.tsx
emitting output/buildfile.tsbuildinfo for ??
Emitting complete
Incremental compilation succeeded
c:\temp\typescript-incremental-watch-bug>node compileTypescript.js
Typescript 4.2.0-dev.20210129
reading buildinfo from c:\temp\typescript-incremental-watch-bug\output\buildfile.tsbuildinfo
emitAllAffectedFiles invoked
emitting c:/temp/typescript-incremental-watch-bug/output/out/Hello.js.map for c:/temp/typescript-incremental-watch-bug/src/Hello.tsx
emitting c:/temp/typescript-incremental-watch-bug/output/out/Hello.js for c:/temp/typescript-incremental-watch-bug/src/Hello.tsx
emitting c:\temp\typescript-incremental-watch-bug\output\buildfile.tsbuildinfo for ??
Emitting complete
Incremental compilation succeeded
TypeScript Version: 4.2.0-dev.20201124
Search Terms: incremental relative absolute outdir
Code
https://github.com/perbergland/typescript-incremental-watch-bug
Expected behavior:
Incremental compilation should work when outDir and tsBuildInfoFile are relative paths
Actual behavior:
Incremental compilation does not work when outDir and tsBuildInfoFile are relative paths - source files are emitted every time.
I have boiled it down to the lines above so that if I pass outDir and tsBuildInfoFile as relative paths, I can see that program.emit(undefined, ... ) will re-emit all source files on every call. If I instead pass these paths as resolved absolute paths, it works as expected.
contrast with