@nrwl/js:tsc

Builds using TypeScript.

Options can be configured in project.json when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/reference/project-configuration#targets.

Examples

@nrwl/js:tsc can run the TypeScript Transformers by using the transformers option.

libs/ts-lib/project.json
{ "build": { "executor": "@nrwl/js:tsc", "options": { "outputPath": "dist/libs/ts-lib", "main": "libs/ts-lib/src/index.ts", "tsConfig": "libs/ts-lib/tsconfig.lib.json", "assets": ["libs/ts-lib/*.md"], "transformers": [ "@nestjs/swagger/plugin", { "name": "@automapper/classes/transformer-plugin", "options": {} } ] } } }

Options

assets

Array<oneOf [object , string]>
Default: []

List of static assets.

buildableProjectDepsInPackageJsonType

string
Default: peerDependencies
Accepted values: dependencies, peerDependencies

When updateBuildableProjectDepsInPackageJson is true, this adds dependencies to either peerDependencies or dependencies.

clean

boolean
Default: true

Remove previous output before build.

external

oneOf [string, Array<string>]

A list projects to be treated as external. This feature is experimental

externalBuildTargets

Array<string>
Default: [build]

List of target names that annotate a build target for a project

main

Required
string

The name of the main entry-point file.

outputPath

Required
string

The output path of the generated files.

rootDir

string

Sets the rootDir for TypeScript compilation. When not defined, it uses the root of project.

tsConfig

Required
string

The path to the Typescript configuration file.

transformers

Array<oneOf [string, object ]>
Default: []

List of TypeScript Transformer Plugins.

updateBuildableProjectDepsInPackageJson

boolean
Default: true

Whether to update the buildable project dependencies in package.json.

watch

boolean
Default: false

Enable re-building when files change.

generateLockfile

boolean
Default: false

Generate a lockfile (e.g. yarn.lock) that matches the workspace lockfile to ensure package versions match.