Current Behavior
When I'm running a production build of an app with buildLibsFromSource: true, NX will still run all other "build" targets from the buildable libraries because of the target defaults. But if I understand correctly they wouldn't need to be built at all because the app and the libs are built from the source anyway.
According to https://nx.dev/nx-api/angular/executors/dev-server#buildlibsfromsource the default is buildLibsFromSource=true but also having "build" depend on "^build" is the default in nx.json. I guess changing this could improve build times for a lot of people, wouldn't it? In the end each buildable library used @nx/angular:ng-packagr-lite which produces something which is not used by default..
So finally, I removed "dependsOn": ["^build"], in the targetDefaults just to see.. and it still works..
Did I miss something fundamental here?
Edit:
In real life I have 170+ buildable libraries. I thought I'd profit from the incremental build by later setting buildLibsFromSource: false but NX will (or needs to) check if every library is updated (even checking the cache will be slow with so many projects). We have a lot of separate libraries to get more out of NX affected (i.e. by only running affected Cypress component tests).
Expected Behavior
When buildLibsFromSource is true (which it is by default) a prod build shouldn't execute all other depending libraries "build"-target. Or add a hint in the documentation on how it is supposed to work and how to work around it (in a supported manner).
GitHub Repo
https://github.com/mirobo/nx-angular-tailwind
Steps to Reproduce
Nx Report
Node : 18.14.0
OS : win32-x64
npm : 9.3.1
nx : 17.2.8
@nx/js : 17.2.8
@nx/jest : 17.2.8
@nx/linter : 17.2.8
@nx/eslint : 17.2.8
@nx/workspace : 17.2.8
@nx/angular : 17.2.8
@nx/cypress : 17.2.8
@nx/devkit : 17.2.8
@nx/eslint-plugin : 17.2.8
@nrwl/tao : 17.2.8
@nx/web : 17.2.8
@nx/webpack : 17.2.8
typescript : 5.2.2
Failure Logs
No response
Package Manager Version
No response
Operating System
Additional Information
No response
Current Behavior
When I'm running a production build of an app with
buildLibsFromSource: true, NX will still run all other "build" targets from the buildable libraries because of the target defaults. But if I understand correctly they wouldn't need to be built at all because the app and the libs are built from the source anyway.According to https://nx.dev/nx-api/angular/executors/dev-server#buildlibsfromsource the default is buildLibsFromSource=true but also having "build" depend on "^build" is the default in nx.json. I guess changing this could improve build times for a lot of people, wouldn't it? In the end each buildable library used @nx/angular:ng-packagr-lite which produces something which is not used by default..
So finally, I removed "dependsOn": ["^build"], in the targetDefaults just to see.. and it still works..
Did I miss something fundamental here?
Edit:
In real life I have 170+ buildable libraries. I thought I'd profit from the incremental build by later setting
buildLibsFromSource: falsebut NX will (or needs to) check if every library is updated (even checking the cache will be slow with so many projects). We have a lot of separate libraries to get more out of NX affected (i.e. by only running affected Cypress component tests).Expected Behavior
When buildLibsFromSource is
true(which it is by default) a prod build shouldn't execute all other depending libraries "build"-target. Or add a hint in the documentation on how it is supposed to work and how to work around it (in a supported manner).GitHub Repo
https://github.com/mirobo/nx-angular-tailwind
Steps to Reproduce
Nx Report
Failure Logs
No response
Package Manager Version
No response
Operating System
Additional Information
No response