fix(angular): support maxParallel, parallel, and withDeps options in webpack-browser schema#4548
fix(angular): support maxParallel, parallel, and withDeps options in webpack-browser schema#4548LayZeeDK wants to merge 3 commits into
Conversation
Nx Cloud ReportCI ran the following commands for commit 126a537. Click to see the status, the terminal output, and the build insights.
Sent with 💌 from NxCloud. |
|
Looking for guidance on how to pass this test failure in |
|
@LayZeeDK sorry for the late reply and thank you for the PR.
Is you concern the lack of docs? Or the fact that you have to do: |
|
When nx runs any command it reads the tasks runner config from nx.json. This is how it knows what tasks runner to use, what options it has etc. The workspace.json file lists the tasks and configures the executors/builders. The file-server target is a special case cause it actually invokes |
|
I see, @vsavkin. Is there any way we can add these options to for example |
|
@LayZeeDK it depends on the build target. You can have a build target that actually invokes Nx under the hood (as the file-server target does), in this case we could add them. The executor implementing the target has to be able to interpret those params. For instance, the jest executor has a param called maxWorkers, which is analogous to maxParallel. The options in workspace.json configure targets' executors. When you run things like I imagine your use case is something like this: When building myapp, I'd like to always build it with deps and build all the targets in parallel. But I don't want this to affect other targets and other apps. It's a legitimate use case. Right now we allow you to set parallel and maxParallel for all commands, but you cannot set the defaults for some commands. |
Yes, we wanted to set The schema of |
|
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
Current Behavior
The
withDepsoption is required for incremental build when using the@nrwl/angular:webpack-browserexecutor as briefly mentioned in Setup incremental builds for Angular applications > Running and serving incremental builds.This guide also mentions that we can configure
withDepsandparallelin the options of the incrementalservetarget of our workspace configuration. It doesn't mention this for thebuildtarget.However, the
maxParallel,parallel, orwithDepsoptions are not declared in the executor schema or its documentation.Expected Behavior
Seeing as
withDepsis required for the incrementalbuildtarget to work, we should add support for themaxParallel,parallel, andwithDepsoptions in the schema of@nrwl/angular:webpack-browser.Related Issue(s)
Fixes #
Other information
We're building an Nx plugin to convert an application and its library dependencies to use incremental build and this is blocking us from implementing it for the best end-developer experience.
See nx-worker/nxworker#5.