yarn workspaces focus — Yarn CLI reference
Install a focused set of workspaces
yarn workspaces focus
Install a focused set of workspaces
This command runs an install as if the specified workspaces, and the workspaces they depend on, were the only workspaces in the project. If no workspace is listed, Yarn focuses the active workspace. Workspaces are selected by name; the command fails if one of the names isn’t a workspace of the project.
This command has limited impact when using zero-installs, since the cache already contains all packages. In that case, the main difference between a full install and a focused install is a few extra lines in the .pnp.cjs file, at the cost of additional workflow complexity.
If the -A,--all flag is set, the entire project will be installed. Combine with --production to replicate the old yarn install --production.
Install all workspaces in the project
Exclude development dependencies from the focused install
Format the output as an NDJSON stream
Examples#
Install the active workspace and the workspaces it depends on
Install a specific workspace and the workspaces it depends on
Install all workspaces without their development dependencies