explaingit

web-infra-dev/rspack

12,696RustAudience · developerComplexity · 3/5LicenseSetup · moderate

TLDR

A JavaScript and CSS bundler built in Rust that works as a faster drop-in replacement for webpack. It accepts webpack configs, plugins, and loaders while cutting build times dramatically thanks to Rust's native speed.

Mindmap

mindmap
  root((rspack))
    What It Does
      Bundle JavaScript and CSS
      Replace webpack
      Fast Rust core
    Tech Stack
      Rust
      Node.js plugin API
      webpack config compat
    Rstack Ecosystem
      Rsbuild
      Rspress
      Rsdoctor
      Rslib
    Use Cases
      Fast dev builds
      Production bundles
      Static site generation
    Audience
      Frontend developers
      Build engineers
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Speed up an existing webpack project by switching to Rspack without rewriting your build configuration.

USE CASE 2

Get near-instant hot module replacement during development by replacing webpack with Rspack in a React or Vue app.

USE CASE 3

Build a production bundle with tree shaking and minification using a webpack-compatible config file.

USE CASE 4

Generate a static documentation site using Rspress, the static site generator built on top of Rspack.

Tech stack

RustJavaScriptTypeScriptNode.js

Getting it running

Difficulty · moderate Time to first run · 30min

Most webpack plugins and loaders work, but some community plugins may need updates or compatibility workarounds.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

In plain English

Rspack is a tool that bundles JavaScript, CSS, and other web assets together so they can be served to a browser efficiently. Bundling takes the many individual files a web project is made of and combines them into a smaller number of optimized files for production. Rspack is built in Rust, a systems programming language known for speed, which lets it complete builds significantly faster than older JavaScript-based bundlers. The main selling point is compatibility with webpack, which has been the dominant bundler in the JavaScript world for many years. Rspack aims to accept the same configuration files, plugins, and loaders that webpack uses, so teams can switch to it without rewriting their build setup. Features listed in the README include fast startup times, quick hot module replacement (where the browser updates changed modules in real time during development without a full page reload), built-in tree shaking (removing unused code from the final bundle), and minification of output files. Rspack is part of a broader family of tools called Rstack. This includes Rsbuild (a higher-level build tool built on top of Rspack), Rspress (a static site generator), Rsdoctor (a build analyzer), Rslib (for building libraries), Rstest (a testing framework), and Rslint (a linter). Each is a separate package, but they share the same underlying architecture. The project is developed by the web infrastructure team at ByteDance. It is released under the MIT license. Documentation is available on the Rspack website, and the community communicates through Discord.

Copy-paste prompts

Prompt 1
I have a webpack config for a React app. Walk me through migrating it to Rspack and highlight what I need to change or verify for compatibility.
Prompt 2
How do I configure Rspack to code-split a large JavaScript app so each route loads only the code it needs?
Prompt 3
Set up Rspack with hot module replacement for a TypeScript project so the browser updates changed modules without a full page reload.
Prompt 4
How do I use Rsdoctor to analyze my Rspack bundle and find what is making it unexpectedly large?
Prompt 5
I want to build a reusable library with Rspack. How does Rslib help and how is it different from a standard Rspack app build?
Open on GitHub → Explain another repo

← web-infra-dev on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.