1

We have migrated our packages to a monorepo. see sn-client

What we are not sure is that where should we put our dev dependencies. I've seen in monorepos that they put the common dev deps to the root package.json.

But if you put it there then why would you put in the packages package.json?

My question is that what is the best practice for that?

Zoltán
  • 144
  • 1
  • 9
  • See the second half of [this answer, under "this is great for monorepos"](https://stackoverflow.com/a/61467483/8910547) – Inigo Apr 29 '20 at 01:15

1 Answers1

0

We went with a practice that if you can run it from package then it should be under the package. An example: We do testing with jest and enzyme and have a specified config in the monorepo's root package.json. Because of this you can not run jest in the package itself. The same goes for typescript. We have a base tsconfig.json in the root. It wouldn't make sense to try to run tsc in an individual package without the monorepo structure. So we moved all those devDependecies to the root.

Zoltán
  • 144
  • 1
  • 9