DEV Community

Alex Spinov
Alex Spinov

Posted on

Rspack Has a Free API That Builds Webpack Projects 10x Faster With Rust

Rspack is a Webpack-compatible bundler written in Rust. Drop-in replacement — same config format, same plugin API, same loaders. Just 10x faster.

Quick Start

npm install -D @rspack/core @rspack/cli
Enter fullscreen mode Exit fullscreen mode
// rspack.config.js — looks exactly like webpack.config.js
module.exports = {
  entry: './src/index.js',
  output: { filename: 'bundle.js' },
  module: {
    rules: [
      { test: /\.tsx?$/, use: 'builtin:swc-loader' },
      { test: /\.css$/, use: ['style-loader', 'css-loader'] }
    ]
  }
}
Enter fullscreen mode Exit fullscreen mode

Speed Comparison

Bundler Cold Build HMR
Webpack 30s 1-5s
Rspack 3s <100ms
Vite 2s (dev) <50ms

Webpack Compatibility

Most webpack plugins and loaders work with Rspack:

  • css-loader, style-loader, postcss-loader
  • html-webpack-plugin
  • mini-css-extract-plugin
  • Most custom loaders

Migration from Webpack

  1. Install Rspack
  2. Rename webpack.config.js to rspack.config.js
  3. Replace webpack imports with @rspack/core
  4. Run rspack build

That's it for most projects.

Built-in Features (No Extra Plugins)

  • TypeScript (via SWC)
  • CSS Modules
  • Asset modules
  • Tree shaking
  • Code splitting

The Bottom Line

If you have a large Webpack project and can't migrate to Vite, Rspack gives you 10x speed with minimal config changes.


Need to automate data collection or build custom scrapers? Check out my Apify actors for ready-made tools, or email spinov001@gmail.com for custom solutions.

Top comments (0)