Microsoft fixed an issue with Typescript still generating JS compiled output in TS 2.0 even though the source file was deleted. What the solution involved was using file watchers to trigger deletion callback event and removing the tsc watch
file from the source file list.
Is there a reason we can't also delete the target output files when a source file is deleted? This creates issues when you are refactoring as functions / JS types collide and create crashes.
Wouldn't it seem trivial to add a tsconfig compiler option to also delete targets (.js.map
, .js
) so that tsc -watch
will not require user to continuously stop/start or use gulp to clean the output directory? You could easily use a glob pattern to identify target outputs.