Let's say I have multiple packages in my yarn workspaces
.
@mycompany/utils
@mycompany/app
@mycompany/serv
Let's say each of these packages has a dependency
on lodash
. I want to make sure that they all have the same lodash
version.
Is there a way to do that in each of the package.json?
Use syncpack
to force all sub-packages in a monorepo uses the same version of each dependency.
Install in the root package.json:
yarn add --dev -W syncpack
Run (Recommnded: Run on every commit using husky):
syncpack list-mismatches
More info: https://github.com/JamieMason/syncpack
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With