-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
tsc --build takes wrong assumption on project rootDir #41801
Comments
This is the same behavior I reported in #41780. In that bug, |
Duplicate of #41780 |
This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
…am emit file path calculation (#41811) * Baseline showing #41801 and other issues with output path calculation * Add a way to note descripencies between clean and incremental build * Add descripency when no rootDir is specified but project is composite * if rootDir is specified, irrespective of whether all files belong to rootDir, the paths should be calculated from rootDir * Fix the output file names api to use the correct common source directory * Tests for #41780 * Spelling
…am emit file path calculation (microsoft#41811) * Baseline showing microsoft#41801 and other issues with output path calculation * Add a way to note descripencies between clean and incremental build * Add descripency when no rootDir is specified but project is composite * if rootDir is specified, irrespective of whether all files belong to rootDir, the paths should be calculated from rootDir * Fix the output file names api to use the correct common source directory * Tests for microsoft#41780 * Spelling
Why this is still happening after almost one year? This wasted me entire afternoon :( |
@klauszhang The bug described above does not happen anymore on my computer with latest typescript version. |
TypeScript Version: 4.2.0-dev.2020120
Search Terms: tsc, project reference, inconsistent rootdir, builds again
Code
https://github.com/sguillia/ts-bug-repro-II
// No code, an empty TS file is enough to reproduce.
Expected behavior:
Project was built once.
Actual behavior:
Project was built twice.
Playground Link:
No playground link. Typescript Playground does not offer the
outDir
option.Related Issues: not found, sorry
Additional information
Second build logs this message:
dist/src/index.js
is not supposed to exist.dist/index.js
does.Setting the following setting in the tsconfig.json fixes the problem:
But the actual behavior should be consistent even without the
rootDir
settingAs explained here in the docs,
tsc --build
is supposed to consistently detect whether the project is up-to-date.The text was updated successfully, but these errors were encountered: