Running the default @nx/tsc
plugin can result in issues if your config setup does not perfectly match what is expected.
This plugin is a light wrapper around native typescript's tsc
command for type checking, and swc
for actual file output.
Include it as a target in your project.json
.
Has a peer dependency on typescript so make sure that is installed as well. This package is generally tested with the latest version.
{
"name": "my-package",
"targets": {
"tsc": {
"executor": "nx-tsc:build",
"options": { "tsConfig": "{projectRoot}/tsconfig.json" }
},
}
}
This script will load from the specified tsconfig.json
, and specified rootDir. It will output to the outDir.
It is highly recommended to take advantage to Nx's inputs and outputs to take advantage of task caching.
Builds the typescript files in local project, outputting .js
files and
name | type | required | default | description |
---|---|---|---|---|
tsConfig | sring | true | ❌ | Path to tsconfig.json . Respects internal extensions. |