-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@nrwl/web|@nrwl/workspace: Package gets all dependencies of its children #8640
Comments
We'll address this. It never should have been recursive since npm dependencies are only one level deep. |
I think it should ignore recursive when the dependency has the 'publishable' flag. Sometimes you need recursive dependencies when you are not publishing some of the libraries or want to collect everything in one library. |
But consumers of that parent library won't be able to use it without also adding the child libraries, or am I missing something here? For example, I have The only valid use-case for including deps of deps is if we are bundling |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Current Behavior
I have a workspace that has following structure:
core-pkg1
&core-pkg2
have NPM dependencies (i.e. third party)suite-pkg
only re-exports things fromcore-pkg1
&core-pkg2
After build
suite-pkg
contains dependencies of its children inpackage.json
:This happens because
@nrwl/web
and its Rollup executor userecursivelyCollectDependencies()
that actually does recursive collection of dependencies:nx/packages/workspace/src/utilities/buildable-libs-utils.ts
Lines 84 to 96 in 1139c61
Expected Behavior
core-pkg1
&core-pkg2
dependencies used in its sourcessuite-pkg
has onlycore-pkg1
&core-pkg2
in dependencies (again, dependencies used in its sources)Proposal
I see following options:
package.json
filesSteps to Reproduce
npm install
nx run suite-pkg:build
dist/libs/suite-pkg/package.json
Environment
The text was updated successfully, but these errors were encountered: