Articles

Turbopack vs Webpack: Choosing a JS Bundler

Turbopack is a Rust-based bundler built for incremental speed; Webpack is the mature, plugin-heavy standard. How they differ and when to pick each.

Takina Takina · · 5 min read
A dark-themed code editor showing JavaScript

Turbopack and Webpack are both bundlers that take a graph of JavaScript, CSS, and asset imports and turn it into optimized files a browser can load, but they’re built on different generations of tooling. Webpack is the JavaScript-based bundler that defined the modern build-tool era and grew an enormous plugin ecosystem over the years. Turbopack is a newer, Rust-based bundler built around incremental computation from the ground up, designed to make large applications rebuild fast during development.

What Webpack is

Webpack takes an entry file, walks every import/require it finds, and builds a dependency graph that it bundles into one or more output files. Its core idea — everything is a module, and loaders transform any file type into something the bundler can include in that graph — is what let it become the default for so long. Need to import CSS, images, or SVGs directly in your JavaScript? A loader handles it. Need code splitting, minification, or environment-specific builds? A plugin handles it.

That flexibility comes from Webpack’s config-and-plugin architecture, which is also its biggest complaint: a nontrivial Webpack config can grow into hundreds of lines coordinating loaders, plugins, and optimization settings, and understanding why a build behaves a certain way often means reading plugin source. Webpack itself is written in JavaScript and runs on Node, which puts a ceiling on how fast it can process large graphs compared to tools written in a compiled language.

What Turbopack is

Turbopack is written in Rust and built around a different core assumption: instead of rebuilding whatever changed by re-running transforms over affected files, it models the whole build as a graph of cacheable function calls. When a file changes, Turbopack only recomputes the parts of that graph whose inputs actually changed, and reuses the rest — including across restarts, since results can persist to disk.

This function-level caching is the main architectural bet: rather than optimizing the “cold, from-scratch build” case, Turbopack optimizes the “I changed one file in a huge app, now update the dev server” case, which is the loop developers sit in for most of a working day. It’s built by Vercel and ships as the bundler option in Next.js, though it’s designed to be usable outside that framework too.

Comparison

WebpackTurbopack
Implementation languageJavaScript (Node)Rust
Core modelLoaders + plugins over a module graphIncremental, cacheable function graph
Ecosystem maturityVery large; years of loaders and pluginsNewer; growing compatibility layer for Webpack loaders
Config styleExplicit, often extensive webpack.config.jsConvention-heavy, less manual configuration
Best-known useGeneral-purpose bundler for any frameworkNext.js’s bundler; usable standalone
Incremental rebuild strategyRe-run affected transformsRecompute only changed parts of a cached graph

Ecosystem is still the deciding factor

Webpack’s plugin ecosystem is the product of a decade of real-world build problems being solved by the community — obscure asset formats, legacy module systems, framework-specific optimizations, monorepo quirks. If a project depends on a specific Webpack plugin with no equivalent, that’s a real switching cost, not a matter of taste. Turbopack includes compatibility support for a subset of common Webpack loaders, but “a subset” is the operative phrase — it’s not a drop-in replacement for an arbitrary Webpack config.

This is the same tradeoff that shows up whenever a faster, newer tool challenges an established one — see how Vite took a similar bet on native ES modules over bundling everything up front, and eventually built enough ecosystem support to become a mainstream default rather than a niche pick.

Where the speed actually comes from

It’s tempting to attribute Turbopack’s speed purely to “Rust is faster than JavaScript,” but the bigger factor is the caching model. A from-scratch build still has to process every file at least once, so raw language performance matters there. The bigger win shows up in the loop most developers actually live in: edit a file, see the change. Because Turbopack’s cache is keyed at the function level rather than the file level, changing one component doesn’t force it to re-walk unrelated parts of the graph, which is where Webpack’s from-scratch-oriented model spends more time by comparison.

Neither tool changes what actually ships to the browser at a fundamental level — both still need to handle tree shaking to drop unused code, module resolution between ESM and CommonJS inputs, and source maps so stack traces point back to your original files rather than the bundled output.

When to choose which

  • Stick with Webpack if your project already has a working config, depends on plugins without a Turbopack-compatible equivalent, or you need the widest possible ecosystem support for an unusual build requirement.
  • Try Turbopack if you’re on Next.js and want faster local dev iteration, or you’re starting a new project where you don’t have years of accumulated Webpack configuration to migrate.
  • Consider Vite instead of either if you’re not tied to Next.js specifically — it solves a similar “fast dev loop” problem with a different architecture and has broader framework-agnostic adoption.

None of these choices are permanent lock-in for the application code itself; bundler configuration lives at the edges of a project, similar to how a monorepo’s build tooling sits alongside the actual source rather than inside it. Migrating later is real work, but it doesn’t require rewriting application logic.

The takeaway

Webpack is the mature, deeply configurable bundler with the largest plugin ecosystem in the JavaScript world; Turbopack is a newer, Rust-based bundler built around incremental, function-level caching to make the edit-and-reload loop fast, currently most at home inside Next.js. Pick based on what you’re actually optimizing for: ecosystem breadth and existing investment favor Webpack, while dev-server speed on a large, actively changing codebase favors Turbopack — and if you’re not locked into a specific framework, it’s worth comparing both against Vite before committing.

Takina Takina · · 4 min read

What Is a Lockfile? Reproducible Dependency Installs

A lockfile records the exact dependency versions your package manager resolved, so every install — from your laptop to CI — reproduces the same tree.

#JavaScript #Web Development #Developer Tools
Takina Takina · · 4 min read

JavaScript Intl API: Formatting Dates and Numbers

The Intl API formats dates, numbers, and currency using a user's locale without a library. How Intl.DateTimeFormat and Intl.NumberFormat work.

#JavaScript #Web Development #Developer Tools