@nx/esbuild:configuration
Add esbuild configuration to a project.
Add esbuild configuration to a project.
1nx g @nx/esbuild:configuration my-package
2
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
.
1nx g @nx/esbuild:configuration my-package \
2--main=packages/my-package/src/entry.ts \
3--tsConfig=packages/my-package/tsconfig.custom.json
4
1nx generate configuration ...
2
1nx g esbuild-project ... #same
2
By default, Nx will search for configuration
in the default collection provisioned in workspace.json.
You can specify the collection explicitly as follows:
1nx g @nx/esbuild:configuration ...
2
Show what will be generated without writing to disk:
1nx g configuration ... --dry-run
2
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.
The name of the project.
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.
build
The build target to add.
[esm]
esm
, cjs
The format to build the library (esm or cjs).
The library name used to import it, like @myorg/my-awesome-lib
.
node
browser
, node
, neutral
Platform target for outputs.
false
Skip formatting files.
false
Do not add dependencies to package.json
.
false
Do not perform any validation on existing project.
Watch the replays of exciting talks on developer tooling and monorepos! Catch all the insightful presentations from the event on our YouTube channel.