You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use yarn to setup a minimal docker image for just one workspace in a larger monorepo. So far, yarn workspaces focus seems to be what I want, however it seems that it still creates symlinks in node_modules to all workspaces in the repo, not just the ones required by the "focussed" workspace. So I can't create the minimal environment I am looking for since unrelated code is still being pulled in. (My plan was to de-reference all the symlinks in node_modules then delete everything else except the app code and node_modules)
For example, consider the following dependency tree:
Workspace_A
Depends on: Workspace_B
Workspace_B
Depends on: External_Dependency_A
Workspace_C
Depends on: External_Dependency_B
When I run yarn workspaces focus Workspace_A I would expect the following node_modules to be generated:
Note that the command has done it's job by ignoring External_Dependency_B since it's focused on Workspace_A, yet it still linked in Workspace_C despite the fact that it has nothing to do with Workspace_A. Is there any way to prevent this?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm trying to use yarn to setup a minimal docker image for just one workspace in a larger monorepo. So far,
yarn workspaces focus
seems to be what I want, however it seems that it still creates symlinks in node_modules to all workspaces in the repo, not just the ones required by the "focussed" workspace. So I can't create the minimal environment I am looking for since unrelated code is still being pulled in. (My plan was to de-reference all the symlinks in node_modules then delete everything else except the app code and node_modules)For example, consider the following dependency tree:
When I run
yarn workspaces focus Workspace_A
I would expect the followingnode_modules
to be generated:But instead I get the following:
Note that the command has done it's job by ignoring
External_Dependency_B
since it's focused onWorkspace_A
, yet it still linked inWorkspace_C
despite the fact that it has nothing to do withWorkspace_A.
Is there any way to prevent this?Beta Was this translation helpful? Give feedback.
All reactions