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

Allow install only production dependencies in flat mode. #2781

Closed
nkt opened this issue Feb 25, 2017 · 9 comments
Closed

Allow install only production dependencies in flat mode. #2781

nkt opened this issue Feb 25, 2017 · 9 comments

Comments

@nkt
Copy link

nkt commented Feb 25, 2017

What is the current behavior?
yarn install --prod --flat asks resolution for both production and development modules and then install all of them.

What is the expected behavior?
yarn install --prod --flat should install only production dependencies.

@bestander
Copy link
Member

PR is welcome

@icd2k3
Copy link

icd2k3 commented Mar 6, 2017

Currently --flat requires you to resolve all conflicting modules... it would be great if there was some kind of "ignore" option to only flat-install some modules.

@robdodson
Copy link

robdodson commented Apr 23, 2017

Glad I found this issue as I was just trying to do the same combo of --flat --production.

For a frontend web project, is it safe to assume that you'd always want your dependencies to be flat installed? Otherwise you'd end up shipping multiple versions of a component or library down to the client which is inherently wasteful.

For devDependencies I think it's totally fine to use the regular nested node install because those are often build tools.

This is something that we in the web components community are really interested in because Custom Elements require you to only register one version of a tag (e.g. you can't have two versions of <x-button> on the page). So flat install is something we're super excited about.

Ideally I'd like to be able to do something like:

yarn install --dependencies --flat --module-folder client_modules
yarn install --dev-dependencies

@sebmck
Copy link
Contributor

sebmck commented Apr 25, 2017

#3251 will fix this.

@kdelmonte
Copy link

@kittens, so this works using the command line?

What about in the package.json? Something like:

flat: 'production'
//or
flat: 'dev'
//or
flat: true

@bestander
Copy link
Member

you can do it in .yarnrc file https://yarnpkg.com/en/docs/yarnrc#toc-cli-arguments

@kdelmonte
Copy link

@bestander I am unclear whether you can choose to install only dependencies in flat mode while continuing to install devDependencies in nested mode. @BYK says that you cannot do this in #4380 but here it is unclear.

@mgibas
Copy link

mgibas commented Mar 19, 2018

Seems like this is not possible at the moment and #3251 is not related :(
Any plans, thoughs ? Without any solution, for web project, dev dependencies generates like 200 unmaintainable resolutions :(

@alexiusp
Copy link

I also would like to see this issue solved. Any ideas when it could be implemented?

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

8 participants