Is there a way to install dependencies for just one package in a yarn2 monorepo?
Asked Answered
S

1

7

to do a yarn immutable install for all packages it yarn 2 recommends yarn workspaces focus --production --all, is there a way to do this for just one workspace? reason being I would like to not have all dependencies for everything installed into docker containers for different applications.

Setser answered 29/9, 2020 at 17:39 Comment(0)
C
7

Yes,

yarn workspaces focus --production (without --all flag)

installs production dependencies just for the workspace in current working directory. You can also specify the name of the workspace as an argument, e.g.:

yarn workspaces focus --production frontend

Crossland answered 30/9, 2020 at 6:50 Comment(1)
The question and my answer are for Yarn 2, not Yarn 1Crossland

© 2022 - 2024 — McMap. All rights reserved.