| name | nx-run-tasks |
| description | Running Nx tasks (build, test, check, etc.) |
Running Nx Tasks
General Nx CLI reference: https://nx.dev/docs/reference/nx-commands#nx-run
Workspace task definitions: ../../../nx.json
How to Run Tasks
nx run <project>:<target>
nx run-many -t <target>
nx run-many -t <target> -p <project1> <project2>
nx affected -t <target>
Task Ordering
Tasks are broken down into high level goals (checking, building, testing...)
See this explanation for why/how that is maintained.
Just select the high level task to focus on and execute it. Dependent tasks will run, but Nx caching should make those very fast.
Note that it is difficult to run a single task (even with --excludeTaskDependencies). For example trying to re-run the tests, without re-running the build step won't actually reflect the recent code changes in the tests.
Useful Flags
-c fix
--skipNxCache
--verbose
--nxBail
--tuiAutoExit
nx affected --base=main
Common Command Shortcuts
These are linked to the /scripts/commands directory (via PATH)
test-ci
test-only
test-and-fix
dagger-test
Finding Available Targets
See enabled targets in project.json, and cross reference against nx.json` and lifecycle.json to exclude the orchestration tasks.