Skip to content

tsc --watch emits all files even when they have not changed #29927

Closed
@gilbert

Description

@gilbert

A regression of #3113 / #6937

TypeScript Version: 3.4.0-dev.20190215

Search Terms: tsc --watch writing to disk too often

TypeScript is writing all files to disk regardless if the contents of those files have changed or not. This is fine on startup, but when using --watch it still behaves this way even when only one file changes. This causes two problems:

  • It's very slow when working with a large number of files
  • It triggers too many file change updates for tools like nodemon

To Reproduce:

First create some files:

$ tsc --version
Version 3.3.1
$ tsc --init
$ echo '//a' > example.ts
$ echo 'require("http").createServer(()=>{}).listen(5050)' > server.js
$ tsc --watch

Then run nodemon server.js, then re-save example.ts with no changes.

Expected behavior:

Only files that have changed should write to disk.

Actual behavior:

All files write to disk.

Related Issues: Seems to be a regression of #3113 / #6937

Metadata

Metadata

Assignees

Labels

FixedA PR has been merged for this issueIn DiscussionNot yet reached consensusSuggestionAn idea for TypeScript

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions