Schema for internal use only

Please do not extend this schema as it is part of Nx internal usage.

@nx/esbuild:configuration

Add esbuild configuration to a project.

nx g @nx/esbuild:configuration my-package
Nx 15 and lower use @nrwl/ instead of @nx/
Overwriting existing build option

The configuration generator validates that an existing build target isn't already defined for the project. If you are adding esbuild to a project with an existing build target, pass the --skipValidation option.

You may also provide a custom main entry file, or a custom tsconfig file if the defaults don't work. By default, the generator will look for a main file matching src/index.ts or src/main.ts, and a tsconfig file matching tsconfig.app.json or tsconfig.lib.json.

nx g @nx/esbuild:configuration my-package \ --main=packages/my-package/src/entry.ts \ --tsConfig=packages/my-package/tsconfig.custom.json
Nx 15 and lower use @nrwl/ instead of @nx/

Usage

nx generate configuration ...
nx g esbuild-project ... #same

By default, Nx will search for configuration in the default collection provisioned in workspace.json.

You can specify the collection explicitly as follows:

nx g @nx/esbuild:configuration ...
Nx 15 and lower use @nrwl/ instead of @nx/

Show what will be generated without writing to disk:

nx g configuration ... --dry-run

Options

main

entryFile
string

Path relative to the workspace root for the main entry file. Defaults to <project-root>/src/main.ts or <project-root>src/index.ts, whichever is found.

project

string

The name of the project.

tsConfig

string

Path relative to the workspace root for the tsconfig file to build with. Defaults to <project-root>/tsconfig.app.json or <project-root>/tsconfig.lib.json, whichever is found.

buildTarget

string
Default: build

The build target to add.

importPath

string

The library name used to import it, like @myorg/my-awesome-lib.

platform

string
Default: node
Accepted values: browser, node, neutral

Platform target for outputs.

skipFormat

boolean
Default: false

Skip formatting files.

skipPackageJson

boolean
Default: false

Do not add dependencies to package.json.

skipValidation

boolean
Default: false

Do not perform any validation on existing project.