Turbopack is a next-generation incremental bundler optimized for JavaScript and TypeScript. Itâs written in Rust, which makes it extremely fast and efficient in handling apps of any size.
Turbopack is well suited for the modern JavaScript ecosystem with the latest ES6 standards. Itâs quite versatile and integrates well with widely known frameworks and libraries like React, Vue, Angular, or any other modern JavaScript framework.
In this adoption guide, weâll take a look at why Turbopack was created, why you should use it, and some of its standout features. Weâll also go through how to get started with Turbopack and compare it to other popular bundler tools to help you determine whether adopting Turbopack in your next project is the right move.
Turbopack is often considered the natural successor of webpack. While webpack is still widely used in countless production applications, it has its own shortcomings, such as slower builds, poor hot module replacement, and tree shaking.
Numerous open source learnings led webpackâs creator, Tobias Koppers, to develop Turbopack to solve pain points caused by webpack over the years.
When starting a new JavaScript project, you have a ton of good options now in terms of JavaScript bundlers and compilers. Turbopack is one such option that has outperformed a lot of other popular bundlers today.
Turbopack simply started out as a project to move away from JavaScript-based bundlers like Babel, Terser, webpack, and others to provide more efficient bundling in Next.js projects. It addressed the shortcomings and issues of those bundlers, especially webpack.
Letâs take a look at a few of the reasons you should opt to use Turbopack.
The Turbopack team has provided a benchmark comparison with other popular tools with various methodologies. According to the team, it seems to be:
So, yes Turbo team did a really job here in making Turbopackâs performance a huge leap over its predecessor, webpack!
At the time of writing this article, the public CLI is not available yet, and you can only use Turbopack with the latest Next.js version.
Turbopack comes set up out-of-the-box when you install Next.js using the CLI. Youâll be all set to write JavaScript and TypeScript in your app, with Turborepo being the default option for bundling your code back to browser-compatible JavaScript.
In terms of usability and learning curve, you can pick it up quickly if you already know how basic bundlers work. Turborepo has familiar surface-level JavaScript APIs that are easy to use with basic configuration in the Next.js codebase.
Turbo has a significantly smaller bundle size compared to webpack. As of now, since itâs only available with Next.js, itâs hard to comprehend the exact bundle size. However, you can always check the Next.js apps bundled with webpack vs. Turbopack, and you should notice that Turbopackâs bundle size is drastically smaller.
Turbopack is relatively early in its development, so you wonât find very exhaustive documentation or an ecosystem as large as webpackâs or Viteâs. That also results in limited plugins and general community support.
But fortunately, the Turbopack team has a very structured and well-planned roadmap. They plan to make Turbopack compatible with more frameworks and libraries, starting with SvelteKit. Also, theyâre working on their own CLI to build applications from scratch that are not necessarily tied to a particular library.
Getting started with Turbopack is quite straightforward. At the time of writing this article, Turbopack is available to use with Next.js v14 and will be released as a standalone CLI in the future along with support for other libraries like Vue, Svelte, etc.
Make sure you have Node installed on your local machine. You can get started by installing Next.js:
npx create-next-app --example-app with-turbopack
Notice the with-turbopack flag that allows Next.js to use Turbopack as a bundler for a TypeScript codebase. Once installed, you can simply run the project using npm run dev.
In the package.json file, make sure to add the --turbo flag in the dev script tag like so:
{
"scripts": {
"dev": "next dev --turbo"
}
}
Now, you are all set to use Turbopack to bundle your TypeScript code in your Next.js app.
Letâs look at some of the key concepts of Turbopack that made Next.js move away from Webpack to Turbopack and why it is the future for JavaScript bundlers or apps of any size:
.ts files. However, it doesnât perform type checks because it uses SWC for compilation, which doesnât perform any static type checking for TypeScriptTo use Browserlist, you can simply add the config to the package.json file, and Turbopack will support it:
{
"browserslist": ["last 2 version", "> 1%", "not dead"]
}
What are some of the factors that make a bundler a âgoodâ option for a project? Here are a few:
Now, Turbopack is well-positioned to deal with all these points efficiently. However, other bundlers like webpack and Vite are popular for good reason. Letâs see a quick rundown on how Turbopack compares with these two other bundlers.
webpack is by far the most used bundler today in production apps. Itâs highly configurable compared to Tuborepo thanks to huge amounts of support from the open source community, while Turbopack has a lot of catching up to do.
However, configuring webpack is daunting, and thereâs a steep learning curve to consider. Meanwhile, at the moment, Turbopack is a no-brainer to work with and has everything out of the box.
Since Turbopack was specifically created by webpackâs creator to address its pain points, itâs easy to think of Turbopack as the best choice between the two. Itâs extremely efficient in bundling and HMR, while webpack can be a hit-or-miss situation.
However, if community support, documentation, maturity and stability, and flexibility are important factors for you, you might want to consider sticking with webpack for now.
Likewise, if there are any webpack plugins that donât yet exist in Turbopackâs plugin ecosystem, or youâre working on an existing project that uses webpack, migrating to Turbopack might not be worth the effort.
Vite uses ES modules during development and Rollup for creating production bundles, so it may be more compatible with certain projects.
Viteâs Fast Refresh and HMR are practically on par with the Turbopack and also quite efficient in handling large-scale production bundling, although Turbopack still has the edge in terms of performance and speed. According to some unofficial estimates, it could be 10x faster than Vite.
Also, Viteâs ecosystem and plugin support is significantly better than Turbopack thanks to its open source community. Vite recently became quite popular as it supports a huge number of frameworks and libraries. Itâs also a little more mature compared to Turbopack.
If youâre working with Next.js, Turbopackâs tight integration with the framework may make it a better choice for your needs. It could also be a good option for new projects â however, if plugin support, compatibility with older browsers, and other Vite-specific features are important, itâs still an excellent and highly performant option.
Letâs recap some of the similarities and differences between Turbopack, webpack, and Vite:
| Aspects | Webpack | Vite | Turbopack |
|---|---|---|---|
| Initial release | 2012 | 2020 | 2022 |
| Developed usingâĶ | JavaScript | JavaScript | Rust |
| Development speed | Slower when compared to modern day bundlers | Fast due to ES based bundling | Extremely fast, perfect for large codebases. could be 10x faster than its predecessors |
| Hot Module Replacement (HMR) | Substandard | Fast | Fast with in-place caching strategies |
| Community | Widely known with extensive community support | Much known with growing codebases | Very limitedly known but getting traction rapidly |
| Tree shaking | â | â | â |
| Code splitting | â | â | â |
| Learning curve | Steeper, hence complex | Easy to setup with JavaScript projects | Fair, but much easier than its predecessor, webpack |
| Browser support | Both legacy and modern browsers | More focused on modern browsers | More focused on modern browsers |
| Supported framework | Works with most frameworks | Out-of-the-box integration with React & Vue | Only Next.js integration available now but public CLI is in the works |
| Open source | â | â | â |
This comparison table should give you a great starting point to better evaluate these three tools and determine which one is best suited to your needs.
If youâre working with a Next.js application, Turbopack is clearly the best choice you have today. While other bundlers like webpack or Parcel are highly configurable, thereâs a slim chance you might be doing those configurations yourself while bundling Next.js apps.
However, if you are doing a modern JavaScript or TypeScript setup from scratch, Parcel or esbuild might be the better choices â at least for now, until we get a public CLI and more plugin support for Turbopack.
Install LogRocket via npm or script tag. LogRocket.init() must be called client-side, not
server-side
$ npm i --save logrocket
// Code:
import LogRocket from 'logrocket';
LogRocket.init('app/id');
// Add to your HTML:
<script src="https://cdn.lr-ingest.com/LogRocket.min.js"></script>
<script>window.LogRocket && window.LogRocket.init('app/id');</script>

Learn how to offload long-running Gemini AI requests to Trigger.dev background jobs in Next.js using Server Actions and real-time React hooks.

Learn how to use Google’s LiteRT.js to build a browser-based OCR receipt scanner with WebGPU acceleration and on-device LLM structuring via LiteRT-LM.

Learn how to use the TypeScript Compiler API and AST traversal to extract imports and build a file dependency graph CLI.

Stop generating AI slop with Claude Code. Discover 5 actionable developer tips to manage context windows, enforce rules with hooks, and improve code quality.
Hey there, want to help make our blog better?
Join LogRocketâs Content Advisory Board. Youâll help inform the type of content we create and get access to exclusive meetups, social accreditation, and swag.
Sign up now