Add ability to run a target without running it's dependencies. #23342
Replies: 3 comments
-
I'm not sure I understand the motivation for this. Can you give an example of how this would be dangerous currently / why you would want to disregard configured dependencies? |
Beta Was this translation helpful? Give feedback.
-
Some executors use process.env to set env variables. If those executors/targets are run concurrently in the same process, there are race conditions that can happen. The way to solve that is to fork nx and run the target in separate processes. The problem is that there is no way to do that for targets without also re-executing all the dependencies of the target. A good example is the module federation dev server. Also, it would just simply be nice to be able to run a target and not run it's dependencies from the command line. |
Beta Was this translation helpful? Give feedback.
-
I've converted this to a discussion so we can discuss more easily. |
Beta Was this translation helpful? Give feedback.
-
Description
The ability to run a target without running it's dependencies.
IE just run a target but not it's deps.
Motivation
Currently most executors run targets in-process. Sometimes in parallel. This is dangerous given how many env variables are used in NX executors now.
It would be better if it was easy for an executor to fork off a nx executor with a nx command to just run a single target.
Suggested Implementation
Some option on nx run and run-many.
Alternate Implementations
Beta Was this translation helpful? Give feedback.
All reactions