Q46: What is Turbopack and how does it replace Webpack in Next.js?
Turbopack is an ultra-fast Rust-based incremental bundler built by Vercel designed as the successor to Webpack. It delivers up to 10x faster HMR (Hot Module Replacement) and faster initial development startup by caching function evaluations incrementally in Rust.
Launching Dev Server with Turbopack
// package.json
{
"scripts": {
"dev": "next dev --turbo"
}
}💡 Passing --turbo enables the Turbopack engine for local development builds.
Key Takeaways
- Rust-powered incremental bundler replacing Webpack.
- Provides ultra-fast local dev startup and Hot Module Replacement (HMR).
Knowledge Check
What programming language powers the Turbopack bundler architecture?