-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Api for tsc --build and --incremental #31432
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
…gSet and graph queue
…t anyways is tested with the --watch mode
…nd simplify to use configFileMap
…aths Turn projectPendingBuild to config file map
…l or invalidated use single path)
…r options Also fix return type of readBuilderProgram
|
@sheetalkamat could this API be used from a Language Service |
|
@manucorporat Sorry I missed your question earlier. I am not sure what you mean by |
|
It looks like these APIs either allow fine-granular acccess with In order to trigger the watching behaviour one needs to call However, not all is lost. It is possible to sneak transformers in by using Here is a simple example on Stack Overflow: |
This PR provides api for tooling to use build and incremental options:
TypeStrong/ts-loader#935 shows use of --build api
Solution Builder
Two functions
createSolutionBuilderandcreateSolutionBuilderWithWatchprovide a way to createSolutionBuilderfor given root projects, and build options. The only difference in later is that it also watches the projects for changes to be able to build.buildandcleanprovide a compact way of building/cleaning all root projects provided or project mentioned (including their references).getNextInvalidatedProjectis the API for more granular level operations on each project. This function will give you a project that needs to be either built or needs to update output because prepend changed or just needs update timestamps. Whendonemethod of the returned project is called, it ensures all actions are taken place and its ready to move to next project so that next call togetNextInvalidatedProjectwill return you next project that's invalid or undefined if the build is complete.Incremental Builder Program
createIncrementalProgramandcreateIncrementalCompilerHostare methods similar tocreateProgramandcreateCompilerHostto build the incremental builder program.This also exposes
readBuilderProgramprovides a way to be able to create theEmitAndSemanticDiagnosticsBuilderfrom the.tsbuildinfofor the compiler options. Note that this is special program that is readonly version and it can only be used asoldProgramto create new builder program.