Add Turborepo to your existing project
Turborepo can be used in any project to speed up the execution of scripts in your package.json.
After you install turbo, you'll be able to run all your package.json tasks from turbo instead of your package manager.
By configuring your turbo.json correctly, you'll notice how caching helps your tasks run a lot faster.
Quickstart
- If you don't have one already, create a new application:
npx create-next-app@latest- Install
turbo:
npm install turbo --save-dev- Add a
turbo.jsonfile at the base of your new repository:
turbo.json
{
"pipeline": {
"build": {
"outputs": [".next/**"]
},
"lint": {
"outputs": []
}
}
}- Try running
buildandlintwithturbo:
npx turbo build lintThis runs build and lint at the same time.
- Without making any changes to the code, try running
buildandlintagain:
npx turbo build lintYou should see terminal output like this:
Tasks: 2 successful, 2 total
Cached: 2 cached, 2 total
Time: 185ms >>> FULL TURBOCongratulations - you just completed a build and lint in under 200ms.
To learn how this is possible, check out our core concepts docs.
- Try running
devwithturbo:
npx turbo devYou'll notice that your dev script starts up. You can use turbo to run any script in your package.json.
Last updated on June 5, 2025