What is Turborepo?

Share this video with your friends

Social Share Links

Send Tweet
Published 2 years ago
Updated 2 years ago

Turborepo is a task runner that helps speed up and manage your Monorepos. It's not a dependency management tool. It knows nothing about your dependencies.

It speeds up Monorepos by using local and remote caching as well as incremental builds. It helps to manage your repo with very handy and easy-to-use scripts.

Here is the npm-workspaces repo

So let's hop in and learn about Turborepo!

Note: This course is a continuation of the course Introduction to Monorepos with NPM Workspaces where we initially build out the Monorepo that is used in this course. It is highly suggested to watch that course first before jumping into this one.

Instructor: [0:01] Turborepo is a task runner for monorepos. It is not a dependency management tool. Turborepo doesn't know anything about installing dependencies, upgrading packages, uninstalling dependencies, any of that. What Turborepo does is that it will see the NPM scripts that you're using across all your packages and let's say that it will optimize them. [0:27] Turborepo also has local and remote caching. That means that, for instance, if you run the builder script once and you'll rerun it with the same contents, you will get the same output immediately because that output will be cached.

[0:46] One of the greatest things about Turborepo is that it's easy to use. As I said, Turborepo is a thin layer on top of your monorepo. What is even cooler is that Turborepo is even easier to delete than to install.

[1:03] Turborepo doesn't get in the way as it is only a task runner. You don't have to modify your application code or anything to make it work. Turborepo is smart enough to understand what task should be executed first and what tasks should follow.

[1:24] With Turborepo, you have the flexibility to just run, for instance, let's say the build command in only one of your packages, with a nice filter API that looks a lot like the PnPM API.

[1:38] For this course, I recommend you to do the "Introduction to Monorepos with NPM Workspaces" first, so you can get the most out of it. The code for the NPM Workspaces course can be found in alejandronanez/npmworkspaces.

[1:57] You can clone this repository and start from there if you want or you can grab the final version that is here in Turborepo egghead course.