Add the build
command-line option to compilerOptions map
#32329
Labels
Declined
The issue was declined as something which matches the TypeScript vision
Suggestion
An idea for TypeScript
Search Terms
build compilerOptions
build typescript SDK
build yarn workspaces dependencies with typescript
build option typescript sdk
Suggestion
I'd like to see the build command line argument added to the compilerOptions map in tsconfig.json to allow for services to basically run
tsc -b
when the compiler is run.Use Cases
For building services with project references without passing in the --build or -b flag to the cli command.
This will be useful for developing plugins which can support the new project references functionality and also for codifying the intended compiler functionality in tsconfig.json so people working on the project don't need to know that -b needs to be passed when attempting to compile.
This would be most useful in monorepos which need to have their dependencies compiled before deployment.
Examples
For example, a Typescript project built and deployed utilizing serverless framework, the
serverless-plugin-typescript
package, and yarn workspaces may have a project structure which looks like this.The admin-service depends on the base-handler; as such, the base-handler should be compiled when the admin-service is compiles. The tsconfig for the service may look like this
When
sls deploy
is run in the admin-service directory, theserverless-plugin-typescript
will use the configuration in tsconfig.json and compile the project.I can run
tsc -b
in the service to build the references. However, I cannot create a programmatic plugin for this behavior.It would be ideal to have the tsconfig for the services in this monorepo to look like this
and use the build key to basically run
tsc -build
simply when I runtsc
. Programmatically, this compilerOption would be ideal to pass into the createProgram method.Checklist
My suggestion meets these guidelines:
The text was updated successfully, but these errors were encountered: