June 26, 2025
Rspack 1.4 has been released!
Notable changes:
Starting with Rspack 1.4, we have added Wasm target support, which means Rspack can now run in browser environments, including online platforms like StackBlitz (WebContainers). This enables developers to quickly create prototypes and share code examples without having to configure local environments.
You can try out our online example directly, or learn about the StackBlitz usage guide in this documentation.
In future versions, we will continue to optimize the Wasm version's usability and bundle size.
We are also developing the @rspack/browser
package, which is a browser-specific version of Rspack, allowing you to use Rspack directly in any modern browser without relying on WebContainers or specific platforms.
Over the past few months, we have been continuously collaborating with the SWC team to optimize the performance and reliability of the JavaScript toolchain. After a period of optimization, we are pleased to see that SWC's performance has improved significantly, benefiting both Rspack users and all SWC-based tools:
The above data is from: CodSpeed - SWC, compared against SWC 16 used by Rspack 1.3 as the baseline.
SWC has enhanced its dead code elimination (DCE) capabilities in the current version, which combined with Rspack's powerful tree shaking functionality, enables Rspack 1.4 to generate smaller bundles.
We tested this using react-router
as an example: by importing only part of its exports in the source code and then comparing the build outputs from different bundlers, we found that Rspack generates the smallest bundles.
The output bundle sizes by different bundlers are as follows:
Bundler | Minified Size | Min+Gzipped Size |
---|---|---|
Rspack (Rsbuild) | 36.35 kB | 13.26 kB |
webpack | 36.96 kB | 13.37 kB |
Vite | 42.67 kB | 15.67 kB |
Rolldown | 42.74 kB | 15.17 kB |
Rolldown Vite | 43.42 kB | 15.46 kB |
Farm | 43.42 kB | 15.63 kB |
Parcel | 44.62 kB | 16.07 kB |
esbuild | 46.12 kB | 16.63 kB |
Bun | 57.73 kB | 20.8 kB |
Data from react-router-tree-shaking-compare.
After extensive optimization, Rspack's incremental build has become stable. In Rspack 1.4, we've enabled incremental build for all phases by default, which significantly speeds up rebuilds - HMR performance typically improves by 30%-40%, depending on the project.
Here is a performance comparison from one user after enabling incremental build:
If you need to revert to the previous behavior, you can set experiments.incremental to 'safe'
. However, we recommend that most projects use the new default configuration to achieve optimal performance.
Rspack 1.4 introduces an experimental CssChunkingPlugin specifically designed for handling CSS code splitting. This plugin ensures that styles are loaded in the same order as they are imported in the source code, preventing UI issues caused by incorrect CSS loading order.
Once CssChunkingPlugin
is enabled, CSS code splitting will be handled entirely by this plugin, and the optimization.splitChunks
configuration will no longer affect CSS modules. You can check the documentation for more details.
This plugin is inspired by Next.js's CSS Chunking feature. Thanks to the Next.js team for their innovation in this area.
Rspack now supports enabling lazy compilation with MultiCompiler
, which means that when you use multiple Rspack configurations in a single build, you can independently configure the lazyCompilation options for each compiler instance.
Rspack now allows you to customize compiler.inputFileSystem
(the compiler's input file system). This feature can be enabled by configuring experiments.useInputFileSystem. Typical use cases include:
Since the custom inputFileSystem
is implemented in JavaScript, it may lead to performance degradation. To mitigate this issue, useInputFileSystem
allows you to pass an array of regular expressions to filter which files need to be read from the custom inputFileSystem
, which avoids performance overhead caused by replacing the native file system.
In the future, we also plan to add built-in virtual module support in Rspack to provide better performance and user experience.
For detailed usage, see the documentation.
Rspack 1.4 introduces more precise tracing capabilities, which can be used for performance analysis based on perfetto to quickly identify build performance bottlenecks.
You can enable tracing through the RSPACK_PROFILE
environment variable:
The generated rspack.pftrace
file can be visualized and analyzed at ui.perfetto.dev:
For more detailed usage, see the Tracing documentation.
In Rspack 1.4, we have upgraded several major dependencies, including:
create-rspack
now provides Biome v2 as an optional linter and formatter.Rstack is a unified JavaScript toolchain built around Rspack, with high performance and consistent architecture.
Rsbuild 1.4 has been released alongside Rspack 1.4, with notable features including:
We've introduced a new rsbuild-plugin-devtools-json plugin, which enables seamless integration with Chrome DevTools' new Automatic Workspace Folders feature. This means you can directly edit and debug your source code in DevTools and save changes to your local file system.
Rsbuild now has built-in support for .js?raw
query parameters, allowing you to import the raw content of JavaScript, TypeScript, and JSX files as text. This is very useful in scenarios where you need to process code as strings (such as displaying code examples).
When you import JS files from other packages in a monorepo, Rsbuild now uses SWC to compile them by default, which helps avoid browser compatibility issues introduced by external dependencies.
As shown in the diagram below, suppose the app's build target is ES2016 and utils' build target is ES2021. When app/src/index.js
imports utils/dist/index.js
, SWC will now downgrade it to ES2016.
Rslib 0.10 has been released, with notable features including:
Rslib now generates cleaner, more concise, and smaller ESM output by default.
By integrating the rsbuild-plugin-unplugin-vue plugin, you can use Rslib to generate bundleless builds for Vue UI libraries.
Rslib now supports generating IIFE format output, wrapping the code in a function expression.
See the blog for more information about Rslib.
We are actively developing Rspress 2.0 and have released multiple beta versions. Currently, we have completed most of the code refactoring work and have integrated Shiki by default in Rspress 2.0 to provide more powerful code highlighting features.
Additionally, we are developing a brand new theme, with the preview shown below:
Rsdoctor has introduced @rsdoctor/mcp-server, which combines LLMs to help you better analyze build data. It can access Rsdoctor's local build analysis data and provide intelligent analysis and optimization suggestions.
Rsdoctor MCP provides bundle analysis, dependency analysis, bundle optimization suggestions, and build optimization suggestions. It can analyze bundle size composition, dependency relationships, and duplicate dependencies, while providing targeted optimization suggestions for bundle size optimization, code splitting, and build performance.
Rstest is a brand-new testing framework built on Rspack that provides comprehensive, first-class support for the Rspack ecosystem. It integrates seamlessly into existing Rspack projects and offers Jest-compatible APIs.
This month, we released Rstest v0.0.3, which provides initial support for Node.js and UI component testing, and has been adopted in our repositories like Rsbuild.
Rstest is currently in its early stages. We recommend staying tuned as we continue to enhance its testing capabilities to provide a more complete solution.
Since Rspack joined the Next.js ecosystem, our primary goal has been to improve the stability and test coverage of next-rspack.
In the latest version, next-rspack has been largely completed, with test coverage reaching:
Moving forward, we plan to continue pushing test coverage to 100% and further optimize the performance of next-rspack.
Kmi is a framework based on Umi and Rspack. By integrating Rspack as the bundler, Kmi delivers build performance improvements several times faster than the webpack version.
For developers currently using Umi, Kmi provides a progressive migration path that allows them to enjoy the performance benefits of Rspack while maintaining project stability.
For more information, see the Kmi repository.
If your project uses SWC Wasm plugins (such as @swc/plugin-emotion
), you need to upgrade the plugins to a version compatible with swc_core@29
, otherwise it may cause build errors due to version incompatibility.
For more details, see FAQ - SWC plugin version unmatched.
The lazy compilation middleware has changed its way of accessing the lazyCompilation option. Now, the middleware can automatically read the lazyCompilation
option from the compiler instance, so you no longer need to manually pass in the lazyCompilation
option.