Running Multiple Tasks
In addition to running individual tasks, you can also run multiple tasks in parallel using the following syntax:
nx run-many -t test lint build
Caching
One thing to highlight is that Nx is able to cache the tasks you run.
Note that all of these targets are automatically cached by Nx. If you re-run a single one or all of them again, you’ll see that the task completes immediately. In addition, (as can be seen in the output example below) there will be a note that a matching cache result was found and therefore the task was not run again.
nx run-many -t test lint build
... ✔ nx run inventory:lint [existing outputs match the cache, left as is] ✔ nx run ui:lint [existing outputs match the cache, left as is] ✔ nx run angular-store-e2e:lint [existing outputs match the cache, left as is] ✔ nx run inventory-e2e:lint [existing outputs match the cache, left as is] ✔ nx run ui:test [existing outputs match the cache, left as is]
——————————————————————————————————————————————————————
NX Successfully ran targets test, lint, e2e for 7 projects (279ms)
Nx read the output from the cache instead of running the command for 10 out of 10 tasks.
Not all tasks might be cacheable though. You can configure which tasks are cacheable in the project configuration or in the global Nx configuration. You can also learn more about how caching works.
Files
Preparing Environment
- Stubbing git
- Installing dependencies