Rspack — The Rust-Powered Bundler That Replaces Webpack with 20x Faster Builds
Posted on: 4/25/2026 11:13:10 PM
Table of contents
- What is Rspack?
- Architecture: Why Rust Beats JavaScript
- Real-World Benchmarks: Rspack vs Webpack vs Vite vs Turbopack
- Migrating from Webpack to Rspack in 6 Steps
- Configuring Rspack for Vue.js Projects
- Rsbuild: Zero-Config Option for New Projects
- Compatible and Incompatible Plugins
- Production Build Optimization with Rspack
- When to Use Which Tool
- Rspack in CI/CD Pipelines
- Conclusion
- References
Webpack has dominated the JavaScript bundler landscape for nearly a decade. But as projects grow — hundreds of thousands of lines of code, thousands of modules — build times escalate from seconds to minutes, sometimes even tens of minutes. Developers wait impatiently, HMR lags, CI/CD pipelines crawl. Rspack was built to solve exactly this problem: keep the familiar Webpack ecosystem, but rewrite everything in Rust to achieve 20x faster builds.
What is Rspack?
Rspack (pronounced "R-S-Pack") is a high-performance JavaScript/TypeScript bundler developed by ByteDance (TikTok's parent company). It's written entirely in Rust and designed to be API-compatible with Webpack, allowing large projects to migrate with minimal config changes.
Unlike Vite (which uses ESBuild for dev and Rollup/Rolldown for production) or Turbopack (tied to Next.js only), Rspack is a general-purpose bundler that works with any framework: React, Vue, Svelte, Angular, or vanilla JavaScript.
Why not just use Vite?
Vite is excellent for new projects. But if you have an existing Webpack project with complex config (custom plugins, Module Federation, loader chains), migrating to Vite could take weeks. Rspack lets you switch in 1-2 days because it preserves your existing Webpack config structure.
Architecture: Why Rust Beats JavaScript
graph TB
subgraph WP["Webpack (JavaScript)"]
WP1["Parse modules
Single-threaded JS"] --> WP2["Build dependency graph
Single-threaded"]
WP2 --> WP3["Babel transpile
Single-threaded"]
WP3 --> WP4["Tree-shaking + Optimize
Single-threaded"]
WP4 --> WP5["Generate bundles"]
end
subgraph RS["Rspack (Rust)"]
RS1["Parse modules
Multi-threaded Rust"] --> RS2["Build dependency graph
Parallel processing"]
RS2 --> RS3["SWC transpile
Native speed"]
RS3 --> RS4["LLVM-optimized
tree-shaking"]
RS4 --> RS5["Generate bundles"]
end
style WP fill:#f8f9fa,stroke:#e0e0e0,color:#2c3e50
style RS fill:#f8f9fa,stroke:#e94560,color:#2c3e50
style WP1 fill:#fff,stroke:#e0e0e0,color:#2c3e50
style WP2 fill:#fff,stroke:#e0e0e0,color:#2c3e50
style WP3 fill:#fff,stroke:#e0e0e0,color:#2c3e50
style WP4 fill:#fff,stroke:#e0e0e0,color:#2c3e50
style WP5 fill:#fff,stroke:#e0e0e0,color:#2c3e50
style RS1 fill:#e94560,stroke:#fff,color:#fff
style RS2 fill:#e94560,stroke:#fff,color:#fff
style RS3 fill:#e94560,stroke:#fff,color:#fff
style RS4 fill:#e94560,stroke:#fff,color:#fff
style RS5 fill:#e94560,stroke:#fff,color:#fff
Pipeline comparison between Webpack (single-threaded JS) and Rspack (multi-threaded Rust)
There are 4 core reasons why Rspack outperforms Webpack by orders of magnitude:
1. Rust instead of JavaScript: Rust is a compiled language with static memory management (zero-cost abstractions) and no garbage collector. Every parse, resolve, and transform operation runs at native speed — 10-100x faster than V8's JavaScript engine for CPU-intensive tasks.
2. Multi-threaded by default: Webpack runs single-threaded on Node.js's event loop. Rspack leverages all CPU cores through Rust's thread pool — module parsing, dependency resolution, and chunk generation all happen in parallel.
3. SWC instead of Babel: Rspack includes a built-in SWC (Speedy Web Compiler) — a Rust-based transpiler that's 20-70x faster than Babel. No need to install babel-loader, @babel/preset-env, or dozens of Babel plugins.
4. Incremental compilation: When you modify a single file, Rspack only rebuilds that module and its direct dependents — not the entire dependency graph like Webpack does.
Real-World Benchmarks: Rspack vs Webpack vs Vite vs Turbopack
| Metric | Rspack 1.x | Webpack 5 + Babel | Webpack 5 + SWC | Vite 8 (Rolldown) | Turbopack |
|---|---|---|---|---|---|
| Production build | 282ms | 6,523ms | 832ms | 4,100ms | N/A* |
| Cold dev start | 1.4s | 45-60s | 15-20s | 2.8s | 2.1s |
| HMR (deep component) | 160ms | 3-5s | 1-2s | 130ms | 70ms |
| Webpack config reuse | ~95% | 100% | 100% | 0% | 0% |
* Turbopack's production build (8.2s) includes Next.js-specific compilation and isn't directly comparable. Benchmarked on 800 React components, 140 routes, ~95K LOC TypeScript, M3 MacBook Pro.
Real-world case study
Mews (Hospitality SaaS company): Migrated their frontend monorepo from Webpack to Rspack — cold start dropped from 3 minutes to 10 seconds, production build from 8+ minutes to 90 seconds (80% reduction). Migration time: 2 days.
Migrating from Webpack to Rspack in 6 Steps
Step 1 — Install Rspack:
# Remove Webpack
npm uninstall webpack webpack-cli webpack-dev-server
# Install Rspack
npm install -D @rspack/core @rspack/cliStep 2 — Rename config file:
# Rename (or copy)
mv webpack.config.js rspack.config.jsStep 3 — Update imports:
// Before (webpack.config.js)
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
// After (rspack.config.js)
const rspack = require('@rspack/core');
// HtmlWebpackPlugin → HtmlRspackPlugin (built-in)
// MiniCssExtractPlugin → CssExtractRspackPlugin (built-in)Step 4 — Replace equivalent plugins:
// rspack.config.js
const rspack = require('@rspack/core');
module.exports = {
entry: './src/main.js',
plugins: [
new rspack.HtmlRspackPlugin({
template: './public/index.html'
}),
new rspack.CssExtractRspackPlugin()
],
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader'
},
{
test: /\.(js|ts)$/,
use: {
loader: 'builtin:swc-loader',
options: {
jsc: {
parser: { syntax: 'typescript' }
}
}
}
}
]
}
};Step 5 — Switch to SWC loader (recommended):
Replace babel-loader with builtin:swc-loader built into Rspack. This step is optional (Rspack still supports babel-loader), but it gives an additional 30-50% build speed improvement.
Step 6 — Update package.json scripts:
{
"scripts": {
"dev": "rspack serve",
"build": "rspack build",
"preview": "rspack serve --mode production"
}
}Configuring Rspack for Vue.js Projects
Rspack supports Vue.js through vue-loader — the same loader you've been using with Webpack. No new tools to learn.
// rspack.config.js for Vue 3
const rspack = require('@rspack/core');
const { VueLoaderPlugin } = require('vue-loader');
module.exports = {
entry: './src/main.ts',
resolve: {
extensions: ['.ts', '.js', '.vue', '.json'],
alias: { '@': path.resolve(__dirname, 'src') }
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
options: { experimentalInlineMatchResource: true }
},
{
test: /\.ts$/,
loader: 'builtin:swc-loader',
options: {
jsc: {
parser: { syntax: 'typescript', tsx: false }
}
},
exclude: /node_modules/
},
{
test: /\.css$/,
use: [rspack.CssExtractRspackPlugin.loader, 'css-loader']
}
]
},
plugins: [
new VueLoaderPlugin(),
new rspack.HtmlRspackPlugin({
template: './public/index.html'
}),
new rspack.CssExtractRspackPlugin(),
new rspack.DefinePlugin({
__VUE_OPTIONS_API__: true,
__VUE_PROD_DEVTOOLS__: false,
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: false
})
]
};Rsbuild: Zero-Config Option for New Projects
If you're starting a new project and don't want to write config, Rsbuild is a high-level wrapper around Rspack — similar to Vite's relationship with Rollup. Rsbuild provides zero-config support for React, Vue, and Svelte with a simple plugin system.
# Create a Vue project with Rsbuild
npm create rsbuild@latest -- --template vue-ts
# Rsbuild config (rsbuild.config.ts)
import { defineConfig } from '@rsbuild/core';
import { pluginVue } from '@rsbuild/plugin-vue';
export default defineConfig({
plugins: [pluginVue()],
source: {
entry: { index: './src/main.ts' }
},
output: {
assetPrefix: '/assets/'
}
});
graph LR
A["New project"] -->|"Zero config"| B["Rsbuild"]
C["Existing Webpack
needs migration"] -->|"Keep config"| D["Rspack"]
E["Project needs
ESM dev server"] -->|"Unbundled dev"| F["Vite"]
B --> G["Rspack Core"]
D --> G
style A fill:#f8f9fa,stroke:#e0e0e0,color:#2c3e50
style C fill:#f8f9fa,stroke:#e0e0e0,color:#2c3e50
style E fill:#f8f9fa,stroke:#e0e0e0,color:#2c3e50
style B fill:#e94560,stroke:#fff,color:#fff
style D fill:#e94560,stroke:#fff,color:#fff
style F fill:#2c3e50,stroke:#fff,color:#fff
style G fill:#16213e,stroke:#fff,color:#fff
Decision tree for choosing the right build tool based on project scenario
Compatible and Incompatible Plugins
| Plugin/Loader | Status | Notes |
|---|---|---|
| vue-loader | ✅ Compatible | Supports Vue 2 & Vue 3 |
| babel-loader | ✅ Compatible | Recommend switching to builtin:swc-loader |
| css-loader / sass-loader / less-loader | ✅ Compatible | Works like Webpack |
| postcss-loader | ✅ Compatible | Tailwind CSS, Autoprefixer work normally |
| ts-loader | ✅ Compatible | Recommend using builtin:swc-loader instead |
| webpack-bundle-analyzer | ✅ Compatible | Bundle size analysis |
| fork-ts-checker-webpack-plugin | ✅ Compatible | Parallel type checking |
| Module Federation | ⚠️ Partial | Rspack has its own Module Federation 2.0 |
| Custom plugins accessing webpack internals | ❌ Incompatible | Plugins using deep compiler.hooks need rewrite |
Production Build Optimization with Rspack
// rspack.config.js — production optimization
module.exports = {
mode: 'production',
optimization: {
minimize: true,
splitChunks: {
chunks: 'all',
cacheGroups: {
vendor: {
test: /[\\/]node_modules[\\/]/,
name: 'vendors',
chunks: 'all',
priority: 10
},
vue: {
test: /[\\/]node_modules[\\/](vue|vue-router|pinia)[\\/]/,
name: 'vue-core',
chunks: 'all',
priority: 20
}
}
}
},
experiments: {
css: true // Native CSS support — no css-loader needed
}
};Migration note
If your Webpack project uses thread-loader or cache-loader, remove them when switching to Rspack. Rspack already has built-in multi-threading and caching at the Rust level — adding these loaders only creates unnecessary overhead.
When to Use Which Tool
| Scenario | Recommended Tool | Reason |
|---|---|---|
| Legacy Webpack project, complex config | Rspack | Fast migration, keeps existing config |
| New project, want zero-config | Rsbuild or Vite | Great DX, no config needed |
| Next.js project | Turbopack | Built-in, optimized for Next.js |
| Library/package bundling | Rollup or tsup | Clean, tree-shakeable output |
| Large monorepo, slow CI/CD | Rspack | Fastest builds, reduces CI costs |
Rspack in CI/CD Pipelines
The biggest benefit of Rspack in production isn't local dev — it's CI/CD. When every PR triggers a build, reducing build time from 8 minutes to 90 seconds means:
- Compute savings: Fewer CI minutes = lower AWS/GitHub Actions costs
- Faster feedback loop: Developers don't wait 10 minutes to know if a build succeeded or failed
- More frequent deploys: When builds are fast, teams confidently deploy multiple times per day instead of batching to once at end of day
# .github/workflows/build.yml
name: Build & Deploy
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: 22 }
- run: npm ci
- run: npx rspack build # ~90s instead of ~8min with Webpack
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist/Conclusion
Rspack isn't a "Webpack killer" — it's a Webpack accelerator. If you have a large Webpack project struggling with build times, Rspack lets you keep your existing knowledge, config, and plugin ecosystem while gaining 20x faster builds thanks to Rust. With Rsbuild for new projects and Rspack for migrations, ByteDance is building a complete build tool ecosystem competing directly with Vite — and each has its own strengths.
References
Astro Framework — The Secret Weapon for High-Performance Websites in the Edge Computing Era
Nuxt 4 — The Fullstack Vue Framework for Production in 2026
Disclaimer: The opinions expressed in this blog are solely my own and do not reflect the views or opinions of my employer or any affiliated organizations. The content provided is for informational and educational purposes only and should not be taken as professional advice. While I strive to provide accurate and up-to-date information, I make no warranties or guarantees about the completeness, reliability, or accuracy of the content. Readers are encouraged to verify the information and seek independent advice as needed. I disclaim any liability for decisions or actions taken based on the content of this blog.