Nx 18: Is there a way to disable a target for a specific app? #22183
Replies: 5 comments 12 replies
-
I have just found out that I can override a target in an actual package (under |
Beta Was this translation helpful? Give feedback.
-
In #22099 (the discussion description), the following is wrong:
Adding |
Beta Was this translation helpful? Give feedback.
-
@FrozenPandaz, sorry to ping you, however, no one from Nx contributors reacted on this discussion (you all are busy, presumably). Basically, in Nx 18 (with Crystal), I’d like to be able to disable a target for specific app (e.g. Thanks in advance! 🙏 Note that I have re-tested this and the target inferring still works like this in Nx 18.3.2. |
Beta Was this translation helpful? Give feedback.
-
In my case I had a dangling Unwanted libs would show up when running I still left |
Beta Was this translation helpful? Give feedback.
-
Related: #22099
I want to disable an automatically interred target (like
test
) for a project.More specifically, my use case is
@jscutlery/semver
. This plugin uses a workspace-levelproject.json
file (I use synced versioning, i.e. one version for all packages). It works as expected, however due to having aproject.json
in the workspace root folder, Nx considers that folder a package root folder and thus shows it innx show projects
.It also infers the following
test
target:Note that I already create some custom targets using
@jscutler/semver
which are not shown innx show project $workspace
($workspace
being the value ofname in the workspace-level
project.json`).I tried to overried the
test
target using the following one, however, it is ignored andnx show project $workspace
still returns the target above.Ideally, I don’t want to infer any task to the workspace-level
project.json
(i.e. it should be used by Nx to run the explicitly specified targets only).A consequence of this is that now I cannot use
nx generate
command, as it throws an error:The only way to work around the issue is to (temporarily) rename the workspace-level
project.json
, for example:mv package.json{,.bak}
;nx reset
;nx generate
;mv package.json{.bak,}
).I suggest to add a concreate example how to override a target/task in the docs. You actually link to that page from Overriding Inferred Task Configuration, however, nothing works for me in this case.
Beta Was this translation helpful? Give feedback.
All reactions