J.Gong
2025-07-11
0.44min
⚡ Rebuilding a Project with Rspack
In Babylon Editor & Babylon Toolkit, I mentioned that the old project template was using Webpack, which was painfully slow. Migrating to Vite was tricky because of all the legacy tech involved.
I heard that Rspack has great Webpack compatibility, so I decided to give it a try — and wow, it was super easy.
Install Rspack
yarn add @rsbuild/core @rsbuild/plugin-react
Add scripts in package.json
{
"scripts": {
"build": "rsbuild build",
"dev": "rsbuild dev --open",
"preview": "rsbuild preview"
}
}
Add rsbuild.config.ts
import { defineConfig } from '@rsbuild/core';
import { pluginReact } from '@rsbuild/plugin-react';
export default defineConfig({
plugins: [pluginReact()],
});
That’s it! Everything just works — you don’t even need an index.html file. 🚀
Rspack feels like a lightning-fast, Webpack-compatible alternative that’s perfect for legacy projects.