How to use Turbopack build tool in Nextjs project

How to use Turbopack the fastest web build tool made with Rust and 😍


Turbopack is the fastest Vercel’s web build tool made with Rust and it smarter than Vitejs which is used in React, Vue and SvelteKit.

Turbopack currently available for Nextjs only.

How do we enable Turbo in Nextjs project. Can try in two methods.

Use a –turbo option in dev script.

 "dev": "next dev --turbo", 

For using old projects there is another way.

Create a turbo.json file in the root of the project with following

//turbo.json
{
  "$schema": "https://turbo.build/schema.json",
  "pipeline": {
    "build": {
      "outputs": [".next/**"]
    },
    "lint": {
      "outputs": []
    }
  }
}

Then we can use the turbo dev command as follows

npx turbo dev

[display-posts tag=nextjs

Author: Manoj

Developer and a self-learner, love to work with Reactjs, Angular, Node, Python and C#.Net

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.