I'm using yarn workspaces (Monorepo) and I added an already made create react app, but now, every time I need to build only one project from the Monorepo, it installs everything from create react app even though it won't be used.
What I need to do is keep everything from create react app in the node_modules from its own package and not in the root node_modules
How can I remove CRA dependencies from the shared dependencies of yarn workspaces?
For example, if I have a Monorepo like
- packages/
- create-react-app
- fooApp
- sharedApp
When running yarn
inside the create-react-app
package, I want to install every dependency used from fooApp
and sharedApp
(this is a expected behavior of yarn workspaces) but when running yarn
inside fooApp
, I want to install every dependency from sharedApp
but not create-react-app
(which I can't, because it's installing dependencies from sharedApp
and create-react-app
).