Skip to content
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

Flat dependencies but deep devDependencies #4380

Closed
johnknoop opened this issue Sep 10, 2017 · 6 comments
Closed

Flat dependencies but deep devDependencies #4380

johnknoop opened this issue Sep 10, 2017 · 6 comments

Comments

@johnknoop
Copy link

Hi

In my web project, I use yarn to resolve dependencies both for web application, in which case I want flat dependencies because the browser can only load one version of a package. However, I also use devDependencies for varies nodejs packages that I use in my build setup. When I use "flat": true I get to pick a specific version for a lot of different subdependencies to my nodejs dependencies. I don't really want to do that, as it isn't necessary. Is there any way to enable flat dependencies for just the dependencies, and leave the devDependencies deep?

@BYK
Copy link
Member

BYK commented Sep 11, 2017

I don't think this is possible since for a consistent dependency structure, all dependency types need to be considered holistically. This means you can't really separate devDependencies from dependencies when calculating the final tree.

Sorry :(

@BYK
Copy link
Member

BYK commented Sep 11, 2017

@arcanis @bestander @kittens LMK if I'm missing something.

@bestander
Copy link
Member

bestander commented Sep 11, 2017

Yeah, afaik flat works across all dependencies.

My first reaction would be to use different package.json files for client and server and use an application level script to ensure those are in sync.
It depends of course on how often they change and how many dependencies are in common.
Maybe the common part could be moved to a workspace and then client and server be still separate package.json file.

@johnknoop
Copy link
Author

Thanks guys for your answers

@BYK
Copy link
Member

BYK commented Sep 12, 2017

@johnknoop you're most welcome!

Are these useful enough to close the issue or would you like to keep the discussion open for any other potential solutions?

@johnknoop
Copy link
Author

@BYK I'm satisfied with the answer. Closing...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants