Webpack is battle-tested but slow. Vite is fast but different. Rspack gives you webpack compatibility at Rust speed — drop-in replacement, 5-10x faster builds.
What Is Rspack?
Rspack is a Rust-based JavaScript bundler fully compatible with the webpack ecosystem. Your existing webpack config, plugins, and loaders work with minimal changes — but builds run 5-10x faster.
Speed Comparison
| Project | webpack | Rspack | Speedup |
|---|---|---|---|
| Dev startup | 12s | 1.5s | 8x |
| Production build | 60s | 8s | 7.5x |
| HMR update | 1.5s | 0.2s | 7.5x |
Quick Start
npm create rspack@latest
# or migrate existing webpack project
npm install -D @rspack/core @rspack/cli
Migration From Webpack
Most webpack configs work directly. Common changes:
// rspack.config.js (instead of webpack.config.js)
const { defineConfig } = require('@rspack/cli');
module.exports = defineConfig({
entry: './src/index.ts',
output: {
path: __dirname + '/dist',
filename: '[name].[contenthash].js',
},
module: {
rules: [
{
test: /\.tsx?$/,
use: {
loader: 'builtin:swc-loader', // Built-in SWC instead of babel-loader
options: {
jsc: {
parser: { syntax: 'typescript', tsx: true },
transform: { react: { runtime: 'automatic' } },
},
},
},
},
{
test: /\.css$/,
type: 'css', // Built-in CSS support
},
],
},
});
What Works From Webpack
- Most loaders — css-loader, file-loader, url-loader, etc.
- Most plugins — HtmlWebpackPlugin, DefinePlugin, etc.
- Code splitting — dynamic imports, splitChunks
- Tree shaking — automatic dead code elimination
- Module Federation — for micro-frontends
- Source maps — all types supported
Built-In Features (No Extra Packages)
module.exports = {
builtins: {
html: [{ template: './index.html' }], // No HtmlWebpackPlugin needed
css: { modules: { localIdentName: '[name]__[local]' } },
define: { 'process.env.NODE_ENV': JSON.stringify('production') },
},
};
Framework Support
-
React —
@rspack/plugin-react-refresh -
Vue —
vue-loaderworks -
Svelte —
svelte-loaderworks - Angular — experimental support
Why Migrate to Rspack
- 5-10x faster builds and HMR
- Drop-in replacement for most webpack projects
- webpack ecosystem compatibility (loaders, plugins)
- Built-in SWC — no need for Babel
- Module Federation 2.0 — advanced micro-frontend support
- Actively maintained by ByteDance
Get Started
- Documentation
- GitHub — 10K+ stars
- Migration guide
Building fast web apps? My Apify scrapers deliver data at Rust-like speed. Custom solutions: spinov001@gmail.com
Top comments (0)