Rspack
Skill ComeOnOliver/skillshub/skills/TerminalSkills/skills/rspack
π§ The right skill, one API call. AI agent skills registry with token-efficient skill resolution. 5,000+ skills from 500+ top repos.From the repository description
npx -y skills add ComeOnOliver/skillshub --skill rspackAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
SKILL.md
4.5 KB, ~1.2k tokens by cl100k_base, as published. Nobody here has run it
Rspack
Overview
Rspack is a Rust-based JavaScript bundler fully compatible with webpack β same config format, same loaders, same plugins, 5-10x faster builds. Created by ByteDance, it's a drop-in webpack replacement: rename your config file, install Rspack, and your existing webpack project builds in a fraction of the time. No config rewrite, no loader migration, no plugin hunting.
When to Use
- Webpack builds taking too long (>30 seconds)
- Want faster builds without rewriting config (unlike Vite migration)
- Large enterprise projects with heavy webpack configs
- Need webpack compatibility (loaders, plugins, config) with better performance
- Migration from Create React App or webpack-based setups
Instructions
New Project
npm create rspack@latest my-app
cd my-app
npm start
Migrate from Webpack
# Install Rspack
npm install -D @rspack/core @rspack/cli
# Remove webpack
npm uninstall webpack webpack-cli webpack-dev-server
// rspack.config.js β Almost identical to webpack.config.js
const { defineConfig } = require("@rspack/cli");
const { HtmlRspackPlugin } = require("@rspack/core");
module.exports = defineConfig({
entry: "./src/index.tsx",
output: {
path: "./dist",
filename: "[name].[contenthash].js",
clean: true,
},
resolve: {
extensions: [".ts", ".tsx", ".js", ".jsx"],
alias: { "@": "./src" },
},
module: {
rules: [
{
test: /\.(ts|tsx)$/,
use: {
loader: "builtin:swc-loader", // Built-in SWC β no babel needed
options: {
jsc: {
parser: { syntax: "typescript", tsx: true },
transform: { react: { runtime: "automatic" } },
},
},
},
},
{
test: /\.css$/,
type: "css", // Built-in CSS support
},
{
test: /\.module\.css$/,
type: "css/module", // CSS Modules built-in
},
{
test: /\.(png|jpg|svg|gif)$/,
type: "asset", // Built-in asset handling
},
],
},
plugins: [
new HtmlRspackPlugin({ template: "./index.html" }),
],
devServer: {
port: 3000,
hot: true,
},
});
Key Differences from Webpack
// What's built-in (no extra loaders/plugins needed):
// β
TypeScript/JSX via SWC β builtin:swc-loader
// β
CSS/CSS Modules β type: "css" / "css/module"
// β
Asset handling β type: "asset"
// β
HTML generation β HtmlRspackPlugin
// β
Code splitting β same as webpack
// β
Tree shaking β built-in
// β
Hot Module Replacement β built-in
// What still uses webpack loaders:
// β
sass-loader, less-loader β work as-is
// β
postcss-loader β works as-is
// β
Most webpack loaders β compatible
With React and Tailwind
// rspack.config.js β React + Tailwind CSS project
module.exports = {
module: {
rules: [
{
test: /\.(ts|tsx)$/,
use: {
loader: "builtin:swc-loader",
options: {
jsc: {
parser: { syntax: "typescript", tsx: true },
transform: { react: { runtime: "automatic" } },
},
},
},
},
{
test: /\.css$/,
use: ["postcss-loader"], // PostCSS processes Tailwind
type: "css",
},
],
},
};
Examples
Example 1: Migrate a webpack project to Rspack
User prompt: "Our webpack build takes 60 seconds. Speed it up without rewriting the config."
The agent will install Rspack, adapt the existing webpack.config.js (minimal changes), replace babel-loader with builtin:swc-loader, and benchmark the improvement.
Example 2: Set up a new React project with Rspack
User prompt: "Create a new React + TypeScript project with fast builds."
The agent will scaffold an Rspack project with SWC for TypeScript/JSX, CSS Modules, asset handling, and dev server with HMR.
Guidelines
- Drop-in webpack replacement β same config format, most loaders work
builtin:swc-loaderβ replaces babel-loader, 20x faster transpilationtype: "css"β no css-loader/style-loader neededtype: "asset"β no file-loader/url-loader needed- Most webpack plugins work β check @rspack/compat for compatibility layer
- HMR is built-in β faster than webpack's HMR
- Tree shaking built-in β no extra config needed
- 5-10x faster β Rust parallelism beats single-threaded JS
- Production-ready β used by ByteDance at scale
@rspack/cliβ providesrspack serveandrspack buildcommands
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.