You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The new option fixes#2644, which is a reactivation of #287, and has been in discussion in #2034.
Background
The current behavior of the compiler when using --outDir is to duplicate the input structure in the output under the value of --outDir. the root of the input is computed as the longest common path of all source (.ts and not .d.ts) files. so an input of FolderA\FolderB\1.ts and FolderA\FolderB\2.ts would result in computing the commonSourceRoot to FolderA\FolderB\. now if a new file FolderA\3.ts is added to the input, the commonSourceRoot will pop out to FolderA\.
This is generally undesirable and can be confusing. it also does not allow for folders that do not contain .ts files to be replicated in the output.
--rootDir flag
The new flag is used to customize the commonSourceRoot instead of automatically calculating it.
The same rules apply, i.e. all source files (.ts) should be under the rootDir, otherwise the output generation may not be correct.
The name rootDir is meant to resemble outDir as both flags go together.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
None yet
5 participants
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.
The new option fixes #2644, which is a reactivation of #287, and has been in discussion in #2034.
Background
The current behavior of the compiler when using
--outDir
is to duplicate the input structure in the output under the value of--outDir
. the root of the input is computed as the longest common path of all source (.ts and not .d.ts) files. so an input ofFolderA\FolderB\1.ts
andFolderA\FolderB\2.ts
would result in computing the commonSourceRoot toFolderA\FolderB\
. now if a new fileFolderA\3.ts
is added to the input, the commonSourceRoot will pop out toFolderA\
.This is generally undesirable and can be confusing. it also does not allow for folders that do not contain .ts files to be replicated in the output.
--rootDir
flagThe new flag is used to customize the commonSourceRoot instead of automatically calculating it.
The same rules apply, i.e. all source files (.ts) should be under the rootDir, otherwise the output generation may not be correct.
The name
rootDir
is meant to resembleoutDir
as both flags go together.