2

Is there a "correct" way to have globally available scripts w/ yarn workspaces?

Let's take typescript as an example. If I install it at the root level using yarn add -W typescript it's not available in any of my workspaces:

child-workspace$ yarn tsc
yarn run v1.22.10
error Command "tsc" not found.

Now I can install tsc into every workspace, along with babel, jest, etc etc etc, but that's awfully redundant. I'm looking for a way to have tools at the global level that are used by each of the workspaces.

Even better, if possible, would be if there were a way to have a "build" workspace and have all the scripts from that globally available so they can be cleanly separated from the workspace root.

0 Answers0