1 | initial version |
To add a custom-cli target to the project.json file in Nx, follow these steps:
"build-custom": {
"builder": "@nrwl/workspace:run-commands",
"options": {
"commands": [
{
"command": "echo 'Custom Build!'"
}
]
}
}
In this example, a new target named "build-custom" is added, which simply echoes "Custom Build!" when run.
Now you can run the custom-cli target by using the Nx CLI command, e.g. ng run my-project:build-custom
.