You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Judging by the schema, targetDefaults only permits inputs, outputs, and dependsOn fields. A project's target can additionally include executor, options, and configurations.
I would like to be able to define at least executor in targetDefaults, if not also the other fields.
Motivation
I have a monorepo of 100+ packages, 90+ of which have the exact same configurations for builds. I can already DRY up the task dependencies using something like
but I still have to specify the same executor for the build target in 90+ packages.
Suggested Implementation
Since executor is a simple string, there's no complexity w/r/t override semantics: take the target's if present, and take targetDefault's otherwise.
options and configurations are a little trickier. For consistency with dependsOn and greater flexibility, at the cost of losing DRYness, I would say options specified in the project.json overwrite instead of merging with those from nx.json. Same for configurations, except the overriding happens per-named-configuration, rather than for configurations on the whole.
Alternate Implementations
options and each configuration could merge instead of override, but this has a lot of tricky semantics and is probably not appropriate for a first version of the feature. (Off the top of my head, two things: how do you unset fields, and is it a recursive merge, or a shallow one?)
The text was updated successfully, but these errors were encountered:
Description
Judging by the schema,
targetDefaults
only permitsinputs
,outputs
, anddependsOn
fields. A project'starget
can additionally includeexecutor
,options
, andconfigurations
.I would like to be able to define at least
executor
intargetDefaults
, if not also the other fields.Motivation
I have a monorepo of 100+ packages, 90+ of which have the exact same configurations for builds. I can already DRY up the task dependencies using something like
but I still have to specify the same executor for the
build
target in 90+ packages.Suggested Implementation
Since
executor
is a simple string, there's no complexity w/r/t override semantics: take thetarget
's if present, and taketargetDefault
's otherwise.options
andconfigurations
are a little trickier. For consistency withdependsOn
and greater flexibility, at the cost of losing DRYness, I would sayoptions
specified in theproject.json
overwrite instead of merging with those fromnx.json
. Same forconfigurations
, except the overriding happens per-named-configuration, rather than forconfigurations
on the whole.Alternate Implementations
options
and eachconfiguration
could merge instead of override, but this has a lot of tricky semantics and is probably not appropriate for a first version of the feature. (Off the top of my head, two things: how do you unset fields, and is it a recursive merge, or a shallow one?)The text was updated successfully, but these errors were encountered: