In an Angular environment and using NX, I have set up the following script in my package.json
for building the project:
"start:all": "nx run-many --target=build --projects=\"proj1,proj2,proj3,proj4\" --watch --skip-nx-cache"
When running this script, it only builds proj2:build --watch
and starts watching that project without proceeding to build the other 3 projects.
I am aware of NX's watch function. However, I find it to be slower and not caching results as expected. Are there better alternatives to achieve this task efficiently?
I attempted adding
--parallel
and--maxParallel=100
, but that did not resolve the issue.Removing the
--watch
flag allowed all projects to be built, but watch functionality is essential.An interesting discovery was made when removing a specific project causing a dilemma:
Running target build for 3 projects and 1 task they depend on:
Even after removing one project, it still built the removed one (as other dependencies rely on it), successfully built 2 others, but left one project unbuilt.
It seems like there may be issues with how these projects interdepend or how they run in parallel. Any insights on resolving this would be greatly appreciated. Thank you!