@nrwl/esbuild:esbuild-project
Add esbuild configuration to a project.
nx g @nrwl/esbuild:esbuild-project my-package
The esbuild-projet
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 @nrwl/esbuild:esbuild-project my-package \
--main=packages/my-package/src/entry.ts \
--tsConfig=packages/my-package/tsconfig.custom.json
Usage
nx generate esbuild-project ...
By default, Nx will search for esbuild-project
in the default collection provisioned in workspace.json.
You can specify the collection explicitly as follows:
nx g @nrwl/esbuild:esbuild-project ...
Show what will be generated without writing to disk:
nx g esbuild-project ... --dry-run