Skip to content

Incremental build still rebuilding everything #34502

@singerb

Description

@singerb

TypeScript Version: 3.7.x-dev.201xxxxx or 3.6.3

Search Terms: incremental

Code

https://github.com/singerb/ts-incremental-test is a small example repo based on the structure of the private repo I'm working with, which reproduces the problem. Even with typescript@next (originally tested with 3.6.3), I'm seeing the following output:

% rm built/tsconfig.tsbuildinfo                                                                                                 
% time ./node_modules/.bin/tsc --listEmittedFiles                                                                               
TSFILE: <repo>/built/lib/common.js
TSFILE: <repo>/built/lib/library.js
TSFILE: <repo>/built/bin/script.js
TSFILE: <repo>/built/bin/task.js
TSFILE: <repo>/built/tsconfig.tsbuildinfo
./node_modules/.bin/tsc --listEmittedFiles  4.03s user 1.05s system 168% cpu 3.016 total
% time ./node_modules/.bin/tsc --listEmittedFiles                                                                               
TSFILE: <repo>/built/lib/common.js
TSFILE: <repo>/built/lib/library.js
TSFILE: <repo>/built/bin/script.js
TSFILE: <repo>/built/bin/task.js
TSFILE: <repo>/built/tsconfig.tsbuildinfo
./node_modules/.bin/tsc --listEmittedFiles  4.08s user 0.62s system 161% cpu 2.907 total

tsconfig.json is here: https://github.com/singerb/ts-incremental-test/blob/master/tsconfig.json

Expected behavior:

Subsequent builds are faster, and emit no files if no input files were changed.

Actual behavior:

Subsequent builds take the same time, and are emitting all the output files again. My guess is that something undocumented about combining JS and TS is breaking the dependency checking and causing the incremental build to just redo it all.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions