-
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
TS Project build meta-output .tsbuildinfo emitted outside of outDir #43908
Comments
We need clear repro with project structure (including source file structure) showing the issue since the complete structure of project matters when determining where the tsbuildinfo goes. |
@sheetalkamat Here it is, I have created a minimal dummy project for reproduction of the behaviour I described above! π |
It looks like this was done intentionally, at least to some degree, hereβitβs even mentioned in the commit message:
Hereβs a simplified repro: // @Filename: /configs/a/tsconfig.json
{
"compilerOptions": {
"composite": true,
"rootDir": "../../sources",
"outDir": "out"
},
"include": ["../../sources"],
}
// @Filename: /sources/index.ts
export {} The
so the result is Iβm guessing there is a general assumption that the relative path of a config file from its |
Always writing to outDir could cause issues with overwriting tsbuildinfo if two projects use same |
This issue has been marked 'Working as Intended' and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
Thanks for the investigation @sheetalkamat @andrewbranch, but let me strongly disagree on this being closed.
I would suggest that the right "sound" approach would be one/multiple of:
|
We already error if tsbuildinfo will be overwritten on tsbuildinfo from referenced projects but the main problem is not all projects might be referenced so its hard to find it out and will depend on how and what you configure. So changing behavior seems unlikely without breaking world. cc: @orta who documents these things and very good at writing these kind of helpers. |
@sheetalkamat / @orta The docs still say "by default, they are in the same folder as your emitted JavaScript." which is simply not true as we saw in this issue-thread. Any chance getting that fixed? |
Bug Report
π Search Terms
project build output directory
tsbuildinfo
π Version & Regression Information
4.2.4
4.3.0-dev.20210430
β― Playground Link
N/A - problem with project builds
π» Code
Important bits of tsconfig files, all repository code is rooted at
/drive-c/work/c
:π Actual behavior
In case a) the file tsconfig.tsbuildinfo is emitted into
/drive-c/work/c/d/
d/e/f/tests/tsconfig.tsbuildinfo
In case b) the file tsconfig.tsbuildinfo is emitted into
/drive-c/work/c/d/e/
d/e/f/tests/tsconfig.tsbuildinfo
In case c) the file tsconfig.tsbuildinfo is emitted into
/drive-c/work/c/d/e/f/build/
d/e/f/tests/tsconfig.tsbuildinfo
In case c) the file tsconfig.tsbuildinfo is emitted into
/drive-c/work/
d/e/f/tests/tsconfig.tsbuildinfo
All these emit locations are wrong, are polluting my repository, and in case d) tsc emits files completely out of repository tree.
π Expected behavior
In all the cases, tsconfig.tsbuildinfo is placed under $outDir/$name-of-project/$name-of-tsconfig.tsbuildinfo (or similar location under $outDir); in my case a):
/drive-c/work/c/d/e/f/build/tmp/
tests/tsconfig.tsbuildinfo
Notes:
I have various requirements that force me to structure TS projects irrelevant of actual code organization. One of them being that it is not possible to have hand-written .d.ts files become part of (project) compilation output, something that's scattered over multiple issues here: #35296 #39231 #38146
The text was updated successfully, but these errors were encountered: