-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Allow --incremental from command line #30513
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
Conversation
src/compiler/program.ts
Outdated
@@ -2722,6 +2722,10 @@ namespace ts { | |||
createDiagnosticForOptionName(Diagnostics.Option_paths_cannot_be_used_without_specifying_baseUrl_option, "paths"); | |||
} | |||
|
|||
if (options.incremental && !options.configFilePath) { | |||
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_incremental_can_only_be_specified_when_using_tsconfig)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this restriction exist? Is it to determine the name of the .tsbuildinfo
file based on the path of the tsconfig.json?
That would make it impossible for API users to use the incremental
option if they don't use parseJsonConfigFileContent
(or one of the countless similar functions) to create their compilerOptions
because configFilePath
is typically not set.
Would it make sense to allow incremental
if either configFilePath
or tsBuildInfoFile
is defined?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree - would be very nice to just specify a metadata location and then not need a tsconfig. Actually, we probably need that capability to support --incremental
in Visual Studio.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RyanCavanaugh @DanielRosenwasser What do you think. In that case we would want to make tsBuildInfoFile
as command line argument.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The release announcement made it look like there was already a --tsBuildInfoFile
CLI option
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a test with incremental
and tsBuildInfoFile
set, but not out
and no config file.
…anges between compilation
@sheetalkamat are we planning on porting this to a |
@RyanCavanaugh @DanielRosenwasser Do we want this for 3.4.2 ? |
I think it can wait for 3.5 |
@RyanCavanaugh @DanielRosenwasser Please see if this is something we want to do.