@nx/plugin:generator
Create a Generator for an Nx Plugin.
Webinar April 17: Making the Argument for MonoreposWebinar April 17: Making the Argument for MonoreposRegister now!
Create a Generator for an Nx Plugin.
1nx generate generator ...
2
By default, Nx will search for generator
in the default collection provisioned in workspace.json.
You can specify the collection explicitly as follows:
1nx g @nx/plugin:generator ...
2
Show what will be generated without writing to disk:
1nx g generator ... --dry-run
2
Generate libs/my-plugin/src/generators/my-generator
:
1nx g generator my-generator --project=my-plugin
2
Generator name.
The directory at which to create the generator file. When --nameAndDirectoryFormat=as-provided
, it will be relative to the current working directory. Otherwise, it will be relative to the workspace root.
Generator description.
as-provided
, derived
Whether to generate the generator in the directory as provided, relative to the current working directory and ignoring the project (as-provided
) or generate it using the project and directory relative to the workspace root (derived
).
false
Do not add an eslint configuration for plugin json files.
jest
jest
, none
Test runner to use for unit tests.
false
Do not format files with prettier.
The name of the project.
Provide the directory
option instead and use the as-provided
format. The project will be determined from the directory provided. It will be removed in Nx v19.