@nx/plugin:generator
Create a Generator for an Nx Plugin.
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 a generator exported with the name matching the file name. It results in the generator foo
at mylib/src/generators/foo.ts
:
1nx g @nx/plugin:generator mylib/src/generators/foo.ts
2
Generate a generator without providing the file extension. It results in the generator foo
at mylib/src/generators/foo.ts
:
1nx g @nx/plugin:generator mylib/src/generators/foo
2
Generate a generator exported with a different name from the file name. It results in the generator custom
at mylib/src/generators/foo.ts
:
1nx g @nx/plugin:generator mylib/src/generators/foo --name=custom
2
The file path to the generator. Relative to the current working directory.
Generator description.
The generator name to export in the plugin generators collection.
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.