-
Notifications
You must be signed in to change notification settings - Fork 12.8k
"tsc --project tsconfig.json --incremental" doesn't clean files from output folder. #36648
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
|
This issue has been marked as 'Question' and has seen no recent activity. It has been automatically closed for house-keeping purposes. If you're still waiting on a response, questions are usually better suited to stackoverflow. |
It's because of VS Code's integrated Git support. A right-click Our TypeScript compiler only sees working directory changes, i.e. Both being by Microsoft, it would be nice to see relevant Git support in our compiler presumably before looking at other VCS's. |
Makes sense, and this makes it possible to output JS and declaration files as siblings to the input TS files, which is a valid use case. Maybe there can be an option for it though? f.e. |
This happens not only in --incremental mode. |
@sheetalkamat I suppose someone somewhere if going to accidentally publish files they didn't mean to publish. |
@sheetalkamat @RyanCavanaugh can't the Not having this automatic cleanup has at least two pretty bad implications:
It looks like using a third-party tool like Google's Wireit (see its dedicated TypeScript recipe) is right now the only viable way to avoid these problems. |
Uh oh!
There was an error while loading. Please reload this page.
TypeScript Version: 3.7.5
Search Terms:
tsc incremental doesn't clean old files
Code
N/A
Expected behavior:
When, for example, refactoring by renaming a file (and VS Code updates all import statements, etc), then the outputDir should not contain the old file.
Actual behavior:
The output directory contains old unused files.
Prior to trying incremental builds (today for the first time) I was simply doing
rm -rf dist/
to "clean" it first. This doesn't work with incremental builds (#30602).I tried running
tsc --build --clean
andtsc --build ./tsconfig.json --clean
but those don't do anything, old files still remain in the output folder.Note, I have a single tsconfig.json at the root of my project, and compile all my source code into a single output directory all at once with a single
tsc
command. I'm not "composing projects".Playground Link:
N/A
Related Issues:
The text was updated successfully, but these errors were encountered: