Your webpack build takes 90 seconds. You've tried cache-loader, thread-loader, esbuild-loader, persistent caching. Maybe you shaved off 20 seconds. The core problem remains: webpack is single-threaded JavaScript processing millions of modules.
What if you could keep your webpack config — plugins, loaders, module.rules — and just make it 10x faster?
That's Rspack. A Rust-powered webpack replacement with near-complete configuration compatibility.
Performance: Rspack vs Webpack vs Vite
| Operation | Webpack 5 | Rspack | Vite |
|---|---|---|---|
| Cold start (large project) | 35s | 3.5s | 1.2s* |
| HMR update | 800ms | 80ms | 50ms |
| Production build | 90s | 9s | 15s |
| With 10K modules | 120s | 12s | N/A** |
*Vite defers bundling to browser in dev, so cold start is fast but first page load is slower.
**Vite uses Rollup for production, which struggles with very large module counts.
Quick Start — New Project
npm create rspack@latest
cd rspack-project && npm install && npm run dev
Migrate From Webpack — It's Almost the Same Config
// rspack.config.js — looks familiar?
const path = require("path");
const HtmlPlugin = require("html-webpack-plugin"); // Yes, webpack plugins work!
/** @type {import('@rspack/cli').Configuration} */
module.exports = {
entry: "./src/index.tsx",
output: {
path: path.resolve(__dirname, "dist"),
filename: "[name].[contenthash].js",
},
module: {
rules: [
{
test: /\.tsx?$/,
use: "builtin:swc-loader", // Built-in SWC — no install needed
type: "javascript/auto",
},
{
test: /\.css$/,
type: "css", // Native CSS support — no css-loader needed
},
{
test: /\.(png|jpg|svg)$/,
type: "asset", // Native asset handling
},
],
},
plugins: [new HtmlPlugin({ template: "./index.html" })],
resolve: {
extensions: [".tsx", ".ts", ".js"],
},
};
Key differences from webpack:
-
builtin:swc-loaderreplacesbabel-loader(10x faster, built in) -
type: "css"replacescss-loader+style-loader - Most webpack plugins work as-is
What Webpack Plugins Work?
| Plugin | Status |
|---|---|
| HtmlWebpackPlugin | Works |
| MiniCssExtractPlugin | Built-in (type: "css") |
| DefinePlugin | Built-in |
| CopyWebpackPlugin | Works |
| webpack-bundle-analyzer | Works |
| fork-ts-checker-webpack-plugin | Works |
Built-in Features (No Extra Packages)
module.exports = {
builtins: {
// Tree shaking — on by default
treeShaking: true,
// Code splitting
optimization: {
splitChunks: {
chunks: "all",
cacheGroups: {
vendor: {
test: /[\\/]node_modules[\\/]/,
name: "vendors",
},
},
},
},
},
};
Migration Checklist
npm install -D @rspack/cli @rspack/core- Rename
webpack.config.js→rspack.config.js - Replace
babel-loader→builtin:swc-loader - Replace
css-loader+style-loader→type: "css" - Remove
cache-loader,thread-loader(Rspack is already fast) - Update
package.jsonscripts:webpack→rspack - Test. Most configs work with these changes only.
When to Choose Rspack
Choose Rspack when:
- You have an existing webpack project and want faster builds
- Your project has 1,000+ modules where webpack slows down
- You use webpack plugins/loaders that Vite doesn't support
- You want production builds to match dev behavior exactly
Skip Rspack when:
- New project with no webpack investment (consider Vite instead)
- Small project where webpack is already fast enough
- You need experimental features Vite ecosystem provides (like Islands)
The Bottom Line
Rspack is the webpack upgrade path nobody expected — same config, same plugins, 10x speed. If your webpack build time frustrates you, Rspack is a weekend migration.
Start here: rspack.dev
Need custom data extraction, scraping, or automation? I build tools that collect and process data at scale — 78 actors on Apify Store and 265+ open-source repos. Email me: Spinov001@gmail.com | My Apify Actors
Top comments (0)