Rspack 1.3 Release: New Features, Performance Optimizations, Rstack Progress, Ecosystem Updates, and Upgrade Guide
Rspack 1.3 introduces circular‑dependency detection, HTTP imports, lazy‑compilation middleware, AMD module support, 25% faster code splitting, output size reductions, macOS memory optimizations, updates to the Rstack ecosystem (Rsdoctor 1.0, Rsbuild 1.3, Rslib 0.6, Rspress 2.0, Rstest), plus detailed upgrade instructions for module types and SWC plugins.
New Features
Rspack 1.3 adds a built‑in CircularDependencyRspackPlugin (implemented in Rust) that detects runtime circular dependencies with a single graph traversal, reducing overhead compared to per‑module checks.
import { rspack } from '@rspack/core';
export default {
plugins: [new rspack.CircularDependencyRspackPlugin()],
};It also introduces experiments.buildHttp , allowing HTTP/HTTPS resources to be fetched at build time and bundled, replacing the older externalsPresets.web and externalsPresets.webAsync approaches.
export default {
experiments: {
buildHttp: {
allowedUris: ['https://esm.sh/'],
// ...
},
},
};Lazy compilation receives a new Express‑style middleware, simplifying integration with @rspack/cli, Rsbuild, or custom dev servers.
import { rspack } from '@rspack/core';
import config from './rspack.config.mjs';
import DevServer from 'webpack-dev-server';
const compiler = rspack(config);
const middleware = rspack.experiments.lazyCompilationMiddleware(
compiler,
config.experiments.lazyCompilation,
);
const server = new DevServer(compiler, {
setupMiddlewares(other) {
return [middleware, ...other];
},
});AMD module support can be enabled via the amd option, while remaining disabled by default to encourage ES‑module usage.
export default {
amd: {
// ...
},
};Performance Optimizations
The experiments.parallelCodeSplitting option is now enabled by default, delivering a 25% speed boost for code splitting.
Output size is reduced by fully supporting output.environment , allowing Rspack to emit modern JavaScript (e.g., arrow functions) when the target environment permits.
// before
- __webpack_require__.d = function(exports, definition) {
// after
+ __webpack_require__.d = (exports, definition) => {On macOS, Rspack now uses mimalloc v3 by default, cutting rebuild memory usage by 10‑85% depending on project size, and introduces a maxGenerations cache‑expiration mechanism.
Rstack Progress
Rsdoctor 1.0 launches as a Rspack‑specific build analysis tool (compatible with webpack), offering UI improvements, Rust‑rewritten data processing (20% faster), and a module‑search feature.
Rsbuild 1.3 ships alongside Rspack 1.3, adding ?inline and ?raw query‑parameter imports for CSS and static assets.
import inlineCss from './style.css?inline';
console.log(inlineCss); // compiled CSS string
import rawSvg from './logo.svg?raw';
import rawCss from './style.css?raw';
console.log(rawSvg); // raw SVG content
console.log(rawCss); // raw CSS contentRslib 0.6 improves CJS output for static analysis, enhances type‑error reporting, and adds YAML/TOML support.
Upcoming releases include Rspress 2.0 (a revamped static site generator) and Rstest (a test framework powered by Rspack).
Ecosystem
Lynx leverages Rspack, Rsbuild, and Rsdoctor via the Rspeedy toolchain to enable cross‑platform native and web development.
Re.Pack 5, a React Native build tool, now integrates Rspack for performance gains and supports Module Federation 2.
The rsbuild-plugin-react-router adds React Router v7 integration with file‑system routing, SSR, and experimental Module Federation support.
Upgrade Guide
Module sub‑type definitions have been refined; supported types include NormalModule, ContextModule, ExternalModule, and ConcatenatedModule. Identify a module’s type via instanceof checks or constructor name inspection.
// Method 1: instanceof
module instanceof NormalModule;
// Method 2: constructor name
module.constructor.name === 'NormalModule';When accessing the resource property, use guard clauses or type assertions to satisfy TypeScript.
// Guard with "in" operator
if ('resource' in module) {
console.log(module.resource);
}
// Guard with instanceof
if (module instanceof NormalModule) {
console.log(module.resource);
}The SWC core crate has been upgraded to v16; ensure the swc_core version matches the Wasm plugin version to avoid compatibility issues.
References
For detailed documentation, see the official Rspack site, the Rsdoctor release blog, and the respective GitHub repositories linked throughout the article.
ByteDance Web Infra
ByteDance Web Infra team, focused on delivering excellent technical solutions, building an open tech ecosystem, and advancing front-end technology within the company and the industry | The best way to predict the future is to create it
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.