[heft] Ensure rootDir is consistently specified in tsconfig. #2379
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Ensure the "rootDir" setting, which sets the root source directory and can impact output folder structure, is consistently specified in all tsconfig.json files, including build rig profiles.
In places where "rootDirs" virtual directories are necessary for typings folders, ensure the source directory is specified both in "rootDirs" and "rootDir".
Details
Basically, through trial and error, I determined that not setting the "rootDir" property can effect the output folder structure if the root source directory does not contain any TypeScript files. It appears that "rootDir" and "rootDirs" are actually not closely related and "src" needs to be in "rootDir" at a minimum. The "src" directory must also be in "rootDirs" if that setting is added to specify one or more virtual directories (e.g. for "loc-json-ts" and "sass-ts").
How it was tested
On a work project. Plus it builds.