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
In my project.json file, I have a build target using the @angular-devkit/build-angular:browser executor. I can add another target testoutput to its dependsOn array.
If I invoke build directly (nx run build) or indirectly (nx run testcaller, where testcaller is a target that depends on build), testoutput is run before build.
If build is run as the build target of @angular-devkit/build-angular:dev-server, on the other hand, testoutput is not run before each build.
This renders it difficult to enrich the build process with pre-processing/code generation steps.
Expected Behavior
When @angular-devkit/build-angular:dev-server does its live-reload, I expect it to run the dependencies of its build target and only then the build target itself.
Given that this issue occurred for me in the @angular-devkit/build-angular:dev-server executor, I had first reported it on the Angular CLI issue tracker: angular/angular-cli#27937
However, I was told over there that
this issue is not caused by Angular CLI. Please contact the author(s) of the NX project or file an issue on their issue tracker.
And indeed, the @angular-devkit/build-angular:dev-server has exactly the same issue.
Also, the existing issue #5803 sounds a bit similar to this one, but it appears to be specific to a Cypress executor and also is supposedly fixed already, while mine still occurs.
The text was updated successfully, but these errors were encountered:
Current Behavior
In my
project.json
file, I have abuild
target using the@angular-devkit/build-angular:browser
executor. I can add another targettestoutput
to itsdependsOn
array.If I invoke build directly (
nx run build
) or indirectly (nx run testcaller
, wheretestcaller
is a target that depends onbuild
),testoutput
is run before build.If
build
is run as the build target of@angular-devkit/build-angular:dev-server
, on the other hand,testoutput
is not run before each build.This renders it difficult to enrich the build process with pre-processing/code generation steps.
Expected Behavior
When
@angular-devkit/build-angular:dev-server
does its live-reload, I expect it to run the dependencies of its build target and only then the build target itself.GitHub Repo
https://github.com/fhaag/angular-cli-bug-repro/tree/dev-server-build-dependency-issue
Steps to Reproduce
Just start with the default sample from
ng new repro-app
and init NX.In the
project.json
file, add the following two targets:Then modify the
build
target to depend ontestoutput
:Now, run:
nx run build
- will displayTEST
and then execute the build process, as expectednx run testcaller
- will displayTEST
, then execute the build process, and then executeCALLER
, as expectednx run serve
- will just execute the build process; unexpectedly, theTEST
output is nowhere to be seenNx Report
Failure Logs
No response
Package Manager Version
No response
Operating System
Additional Information
Given that this issue occurred for me in the
@angular-devkit/build-angular:dev-server
executor, I had first reported it on the Angular CLI issue tracker: angular/angular-cli#27937However, I was told over there that
And indeed, the
@angular-devkit/build-angular:dev-server
has exactly the same issue.Also, the existing issue #5803 sounds a bit similar to this one, but it appears to be specific to a Cypress executor and also is supposedly fixed already, while mine still occurs.
The text was updated successfully, but these errors were encountered: