- 
                Notifications
    
You must be signed in to change notification settings  - Fork 13.1k
 
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issueHelp WantedYou can do thisYou can do this
Milestone
Description
In current stable and also master (de88ede), tsc --watch will keep recreating file.js during recompilation even when the original file.ts source file is removed. Only workaround is to restart tsc --watch to make it forget about file.ts.
For example,
$ ls incorrect_recreation/
test2.ts  test.ts  tsconfig.json
$ cat tsconfig.json
<empty>
$ node bin/tsc.js --watch -p incorrect_recreation/
message TS6042: Compilation complete. Watching for file changes.
In another terminal:
$ ls
test2.js  test2.ts  test.js  test.ts  tsconfig.json # as expected
$ rm test.ts test.js 
$ ls
test2.js  test2.ts  tsconfig.json # so, no trace of test.js or test.ts now
$ touch test2.ts # force a recompile and wait
$ ls
test2.js  test2.ts  test.js  tsconfig.json # test.js should not have been recreated
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issueHelp WantedYou can do thisYou can do this