@nx/workspace:run-commands
Create a custom target to run any command.
Monorepo World: October 7, 2024Monorepo World: October 7, 2024Join us!
Create a custom target to run any command.
1nx generate run-commands ...
2
1nx g run-command ... #same
2
By default, Nx will search for run-commands
in the default collection provisioned in workspace.json.
You can specify the collection explicitly as follows:
1nx g @nx/workspace:run-commands ...
2
Show what will be generated without writing to disk:
1nx g run-commands ... --dry-run
2
Add the printhello
target to my-feature-lib
:
1nx g @nx/workspace:run-commands printhello --project my-feature-lib --command 'echo hello'
2
Command to run.
Target name.
Project name.
Current working directory of the command.
Env files to be loaded before executing the commands.
Allows you to specify where the build artifacts are stored. This allows Nx Cloud to pick them up correctly, in the case that the build artifacts are placed somewhere other than the top level dist folder.