This is an alpha, sneak peek of Monorepo Maestros. For this iteration, I'm getting all of my thoughts down. In the future, we'll have better information architecture, graphics, and other awesomeness. Your feedback is welcome!

External Package

External packages are those that you install from npm. You've probably been using these since the early days of your JavaScript career so we shouldn't have to explain too much about their fundamentals!

What we will be interested in is how to install packages into the context of your workspaces. Let's take a look.

Always install where the package is needed

When we're working in a monorepo, we have our workspaces creating different scopes within the repository. This means that it's highly probable that the package you're installing doesn't belong in the root of the repository.

Instead, ensure that you install packages within the workspace(s) that they belong in. You can do this in a couple different ways.

  1. Run the install command while you are in your workspace's directory:
Terminal
cd apps/web
npm install react
Terminal
cd apps/web
npm install react
  1. Or use the workspace flag of your package manager:
Terminal
pnpm install react --workspace=web
Terminal
pnpm install react --workspace=web

For more on how to handle external packages with your package manager, see the page for your respective package manager under Package Managers