Description
π Search Terms
build, incremental, composit, tsbuildinfo, location, symlink
Related to: #48314
Maybe: #30946, #48981
π Version & Regression Information
- This is the behavior in every version I tried
β― Playground Link
https://github.com/Jason3S/tsbuild-issue
π» Code
Given the following code:
src/window.ts
import type vscode from 'vscode';
export const state: vscode.WindowState = {
focused: true,
}
tsconfig.json
π Actual behavior
pnpm add -D @types/vscode@1.88.0
pnpm tsc -b .
- Builds as expected.
pnpm add -D @types/vscode@1.89.0
pnpm tsc -b .
<-- Should NOT Build, but it does.

After deleting the outDir
(dist
), it works as expected.

π Expected behavior
For tsc -b .
to re-build files when there are changes to dependencies.
Additional information about the issue
No response
Activity
This is working as intended.
tsc --b
does not check dependencies for upto date ness. It only checks at your root files, output and referenced project upto date ness
Here is output
c:\temp\tsbuild-issue>pnpm build
> tsbuild-issue@1.0.0 build C:\temp\tsbuild-issue
> tsc -b -v .
[1:33:47 PM] Projects in this build:
* tsconfig.core.json
* tsconfig.json
[1:33:47 PM] Project 'tsconfig.core.json' is out of date because output file 'dist/compile.tsbuildInfo' does not exist
[1:33:47 PM] Building project 'C:/temp/tsbuild-issue/tsconfig.core.json'...
c:\temp\tsbuild-issue>pnpm add -D @types/vscode@1.89.0
Packages: +1 -1
+-
Progress: resolved 3, reused 2, downloaded 1, added 1, done
devDependencies:
- @types/vscode 1.88.0
+ @types/vscode 1.89.0
Done in 1.4s
c:\temp\tsbuild-issue>pnpm build
> tsbuild-issue@1.0.0 build C:\temp\tsbuild-issue
> tsc -b -v .
[1:34:07 PM] Projects in this build:
* tsconfig.core.json
* tsconfig.json
[1:34:07 PM] Project 'tsconfig.core.json' is up to date because newest input 'src/window.ts' is older than output 'dist/compile.tsbuildInfo'
Ahhh, that explains why it doesn't work as expected. It only takes local dependencies into account. That is too bad. It means I have to do tsc -b . -f
. I take it that there isn't a compiler option to have it check external dependencies.
By the way, thank you for the -v
option. I was certain it meant --version
and it does, but the meaning magically changes with the -b
option. Only after realizing that you used it in a way I hadn't seen did I think to try tsc -b . --help
. Looking further, I see that there is a --help --all
option that shows everything. But I was surprised that the meaning of an option changes dramatically based upon other options.
I will open a feature request to add a compile option to "monitor external dependencies". I would rather have it take a little bit long to compile reliably than to waste time trying to figure out why something wasn't working only to realize I needed to do a clean build.
To be clear, I was sure this was a bug. I had opened the .tsbuildinfo
file to see if it was tracking the external dependencies. It is. It just is not using them for composite
or incremental
builds. I'm guessing it is there for watch
. Which then leads to the question why watch
behavior would be different than tsc -b .
. Which explains #48314.
This issue has been marked as "Working as Intended" and has seen no recent activity. It has been automatically closed for house-keeping purposes.