Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

egghead.io

Build High-Speed Monorepos with Nx and pnpm Workspaces

via egghead.io

Overview

In a monorepo, all of your apps and packages reside in a single repo. Structuring your code this way has many organizational benefits. You can more easily manage your dependencies, and you can maintain more consistency across your various apps.
But, if you attempted to do this with just yarn or pnpm alone, you'll quickly start running into productivity issues. Your build times will be very long, and you'll have to make sure to run builds for any internal packages an app is depending on.
That's where Nx comes in.
Combining the speed of pnpm with the efficiency of Nx gives you an amazingly performant monorepo setup.
Nx builds a graph of your workspace and all of the connected dependencies. If there is a change anywhere, Nx will know about it and everything that is affected by it.
Which means that Nx is able to use caching to prevent unnecessary builds when nothing has changed. Nx's caching features enable blazing fast <10ms build times
You get to have all the advantages of the monorepo with none of the performance issues!
So start watching this course and learn how to achieve these speeds today.

Syllabus

  • Introduction to Build High-Speed Monorepos with Nx and pnpm Workspaces
  • Create a pnpm Workspace
  • Add a Remix App to a pnpm Workspace Monorepo
  • Use pnpm Filter Commands to Run App Scripts From the Workspace Root
  • Create a Shared Library in a pnpm Workspace
  • Add a Local Package as a Dependency to an App Within a pnpm Workspace
  • Recursively Run Scripts in All pnpm Workspace Projects
  • Install Nx to Start Optimizing Your pnpm Workspace
  • Run Commands with Nx
  • Use Nx run-many to Run Commands in Multiple Projects
  • Configure Nx Caching
  • Configure the Nx Cache Output Location
  • Configure Nx Cache to Ignore Changes to Specified Files
  • Use Nx Named Inputs to Reuse Glob Patterns Across Inputs
  • Use the Nx Task Pipeline to Run Commands Within Local Dependencies
  • Use the Nx Graph to Visualize Your Workspace
  • Further Optimize Your Nx Workspace with Affected Commands
  • Distribute Your Cache with Nx Cloud

Taught by

Juri Strumpflohner

Reviews

4.5 rating at egghead.io based on 57 ratings

Start your review of Build High-Speed Monorepos with Nx and pnpm Workspaces

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.