Target `defaultConfiguration` should be passed to `dependsOn` targets
See original GitHub issueCurrent Behavior
I have an update-config
target which is included using dependsOn
as follows:
"serve": {
"dependsOn": [
{
"target": "update-config",
"projects": "self"
}
],
...
}
When called with an explicit configuration this is passed to the update-config
target:
$ nx run dummy:serve:development
> NX Running target serve for project dummy and 1 task(s) it depends on
> nx run dummy:update-config:development
> nx run dummy:serve:development
⠼ Generating browser application bundles (phase: building)...
When called without an explicit configuration this is NOT passed to the update-config
target:
$ nx run dummy:serve
> NX Running target serve for project dummy and 1 task(s) it depends on
> nx run dummy:update-config
> nx run dummy:serve:development
⠹ Generating browser application bundles (phase: building)...
Expected Behavior
I expect that a call to nx run dummy:serve
which utilises the defaultConfiguration
of the serve
target to also pass this configuration to the dependsOn
targets.
Steps to Reproduce
- Clone the test repo: https://github.com/danielsharvey/nx-10868-dependson-test
- Run
npm install
- Execute
nx run dummy:serve:development
and observe that thedevelopment
configuration is passed to theupdate-config
target. - Execute
nx run dummy:serve
and observe that thedevelopment
configuration is NOT passed to theupdate-config
target.
Failure Logs
Not applicable.
Environment
$ nx report
> NX Report complete - copy this into the issue template
Node : 16.15.0
OS : darwin arm64
npm : 8.12.1
nx : 14.3.6
@nrwl/angular : 14.3.6
@nrwl/cypress : 14.3.6
@nrwl/detox : Not Found
@nrwl/devkit : 14.3.6
@nrwl/eslint-plugin-nx : 14.3.6
@nrwl/express : Not Found
@nrwl/jest : 14.3.6
@nrwl/js : 14.3.6
@nrwl/linter : 14.3.6
@nrwl/nest : Not Found
@nrwl/next : Not Found
@nrwl/node : Not Found
@nrwl/nx-cloud : Not Found
@nrwl/nx-plugin : Not Found
@nrwl/react : Not Found
@nrwl/react-native : Not Found
@nrwl/schematics : Not Found
@nrwl/storybook : 14.3.6
@nrwl/web : 14.3.6
@nrwl/workspace : 14.3.6
typescript : 4.7.4
---------------------------------------
Community plugins:
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Project Configuration - Nx
The following configuration creates build and test targets for Nx. ... params passed to this target to the dependency targets "dependsOn": [{ "projects": ......
Read more >Build Script Basics - Gradle User Manual
This chapter introduces you to the basics of writing Gradle build scripts. It uses toy examples to explain basic functionality of Gradle, which...
Read more >Installing GCC: Configuration - GNU Project
On MIPS targets, make -mllsc the default when no -mno-llsc option is passed. This is the default for Linux-based targets, as the kernel...
Read more >fabric8io/docker-maven-plugin
An external Dockerfile can be specified in which Maven properties can be inserted. ... The default value is target/docker and is only used...
Read more >Using GN build - Google Slides
In the third example it shows passing a source file name. GN will find the target or targets that list that file in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fair, thanks. Perhaps, it could be an optional parameter when defining a default configuration? (whether it is propagated or not)
I am certainly liking the dependsOn feature - it has enabled me to remove multiple embedded
nx run ...
and rely on a single task graph.I can see how it could be confusing, but it feels like it makes sense that when manually specifying a configuration it’s passed to all targets vs the default for each target being used otherwise.
I’m not sure on this, definitely wouldn’t mind other options @FrozenPandaz