[Feature] Add support to list only production dependencies
- [x] I'd be willing to implement this feature (contributing guide)
- [x] This feature is important to have in this repository; a contrib plugin wouldn't do
Describe the user story
As a developer, I'd like to list only production dependencies.
Describe the solution you'd like
I've thought I could use some flag from command info, but it doesn't have any flag for this.
We can add a new flag, something like --production, to the command info.
Describe the drawbacks of your solution
No drawbacks.
Describe alternatives you've considered
I think it doesn't make sense as a plugin because it would be mostly duplicated code.
Additional Comments:
Idk if I'm missing something here, so please let me know.
If you think this feature makes sense, I can start working on the PR.
+1 I am trying to find this feature. I'm comparing Yarn v1 yarn list --production with yarn info, but it's hard to filter what's production and what's not.
This is how my current workaround looks like:
- Delete nodules_modules directory
- Remove
devDependenciesproperty frompackage.json. - Install dependencies, via
yarn install --immutable-cache - Print all dependencies, via
yarn info -A --recursive --json > product.dependencies.json
I am open for better ideas, of course ;)
https://github.com/yarnpkg/berry/issues/5117 is a dupe of this.