NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm
npm, #4399 most downloaded on npm
Node binding for rspack
Latest stable
2.3.2
Last release 12 days ago
10 Nov 2026
Ships on a steady schedule
a new release about every 2 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
4 years old
1132 releases · first in 2022
Drag across the ruler to compare, or tap a release to open it.
HMR now handles code-splitting changes more reliably, reducing unnecessary full-page reloads when chunks are added or rearranged. Newly required chunk
HMR now handles code-splitting changes more reliably, reducing unnecessary full-page reloads when chunks are added or rearranged. Newly required chunks are loaded before HMR accept callbacks run, and changes to async chunk dependencies no longer cause unnecessary update propagation.
rule.asThe experimental rule.as option lets a matched resource use a different path for subsequent rule matching while preserving the original resource for file reading and loaders. For example, as: '[resource-path].txt' lets later .txt rules also process example.source.js. (#15917)
// rspack.config.mjs
export default {
module: {
rules: [
{
test: /\.source\.js$/,
type: 'asset/source',
as: '[resource-path].txt',
},
{ test: /\.txt$/, use: './text-loader.js' },
],
},
};
Here, example.source.js matches the later .txt rule as example.source.js.txt; text-loader.js still receives the contents of the original file.
export * passthrough modulesRspack can now bypass side-effect-free modules that only forward exports with export *, connecting directly to the underlying module. #16472
Mark the package as side-effect-free in package.json:
{
"sideEffects": false
}
// src/value.js
export const value = 42;
// src/passthrough.js
export * from './value.js';
// src/index.js
export * from './passthrough.js';
With optimization.sideEffects enabled (the default in production), the export * connection from index.js can now go directly to value.js, skipping passthrough.js.
export * passthrough modules by @hai-x in https://github.com/web-infra-dev/rspack/pull/16472x in ns to true when x is a re-exported namespace by @hai-x in https://github.com/web-infra-dev/rspack/pull/16509swc_core from 84.0.1 to 84.0.2 by @CPunisher in https://github.com/web-infra-dev/rspack/pull/16547Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.3.1...v2.3.2
Your coding agent can read these notes before it upgrades. Set up the MCP server →
feat(runtime): support incremental runtime module updates by @JSerFeng in https://github.com/web-infra-dev/rspack/pull/16326
Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.3.0...v2.3.1
feat: rename loader filter.code to codeFilter by @SyMind in https://github.com/web-infra-dev/rspack/pull/16184
extends through the real path by @orgads in https://github.com/web-infra-dev/rspack/pull/15718Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.2.9...v2.3.0
perf(watch): lazily convert native watcher time info by @stormslowly in https://github.com/web-infra-dev/rspack/pull/16187
Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.3.0-beta.1...v2.3.0-rc.0
Thefilter.code loader option (introduced in 2.3.0-beta.0) has been renamed tocodeFilter . If you are upgrading from 2.3.0-beta.0, replacefilter: { cod
Thefilter.code loader option (introduced in 2.3.0-beta.0) has been renamed tocodeFilter . If you are upgrading from 2.3.0-beta.0, replacefilter: { code: ... } withcodeFilter: ... in your loader config. No action is needed if you never usedfilter.code .
// 2.3.0-beta.0
{ loader: 'my-loader', filter: { code: 'customMacro(' } }
// 2.3.0-beta.1
{ loader: 'my-loader', codeFilter: 'customMacro(' }
Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.3.0-beta.0...v2.3.0-beta.1
Rspack now uses SWC Next for JavaScript parsing. This beta also includes follow-up compatibility fixes for block-scoped functions, parser source types
Rspack now uses SWC Next for JavaScript parsing. This beta also includes follow-up compatibility fixes for block-scoped functions, parser source types, and legacy parser behavior. See #16089.
The new loader filter.code option accepts a string or regular expression and checks the loader's current input before running its normal transform. Loaders can skip files that do not contain the syntax or markers they need to process, avoiding unnecessary transformation work. For example, a loader that transforms customMacro() calls can use filter: { code: 'customMacro(' } to skip inputs without that marker. Pitch functions are unaffected. See #16073.
Named cache groups now remove redundant module copies from source chunks connected to the same shared chunk, reducing duplicate code in affected builds. Rspack also supports splitChunks.minRemainingSize to avoid splits that leave undersized chunks, bringing JavaScript and extracted CSS output closer to webpack. For example, an affected asynchronous CSS import now retains its expected controls.css filename in production. See #16075 and #15594.
Native and Node watch file systems now expose watchpack-compatible getTimes(), getTimeInfoEntries(), and collectTimeInfoEntries() APIs. With experiments.nativeWatcher, compiler.fileTimestamps, compiler.contextTimestamps, and the watcher's getInfo() now return real timestamp entries, improving compatibility with plugins that rely on watch metadata, such as ts-loader, webpack-virtual-modules, and vue-loader. The Node watcher also merges time-info entries deterministically so directory timestamps are preserved regardless of dependency iteration order. See the WatchFileSystem API documentation, #15754 and #16126.
Rspack avoids retaining serialized source maps, reducing memory retained by source objects. Source handling also uses a source-wide UTF-16 index and removes its object pool. See #16072 and #16083.
New allocative-based memory diagnostics help identify which Rust data structures retain memory during builds and HMR updates. See the memory diagnostics guide to capture and analyze snapshots.
extends through the real path by @orgads in https://github.com/web-infra-dev/rspack/pull/15718Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.2.9...v2.3.0-beta.0
Rspack's chunking algorithm has been improved to reduce duplicate modules across chunks.
Rspack's chunking algorithm has been improved to reduce duplicate modules across chunks. (#15885)
https://github.com/user-attachments/assets/0840ec5b-7eea-4d37-9053-cc5cef176103
Rspack upgrades browserslist-rs and enables deflate compression for its browser data, reducing native binary by 2.13 MB (3.08%). (#16009)
Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.2.8...v2.2.9
feat: support JavaScript URL entries with factory type probes by @intellild in https://github.com/web-infra-dev/rspack/pull/15666
Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.2.7...v2.2.8
The new optimization.splitChunks.dedupDepth option lets Rspack spend more build time finding shared code and reducing duplication, giving you more con
The new optimization.splitChunks.dedupDepth option lets Rspack spend more build time finding shared code and reducing duplication, giving you more control over the balance between bundle size and build time. In one application with many routes, this option reduced total output size by 9.9%.
It defaults to 1 in production and 0 in development. #15497
<img width="600" src="https://github.com/user-attachments/assets/72e1c67a-5101-40fb-81a4-c9400ae2b607" />
This release reduces repeated work and allocations during chunk graph construction and CSS Modules class name generation. JavaScript loaders also avoid copying their input content on each invocation, further reducing processing overhead.
Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.2.6...v2.2.7
feat(loader): support buildInfo custom fields in parallel loaders by @stormslowly in https://github.com/web-infra-dev/rspack/pull/15629
Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.2.5...v2.2.6
feat: expose new cache options and enable cache store in rebuild by @ahabhgk in https://github.com/web-infra-dev/rspack/pull/15690
Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.2.4...v2.2.5
CSS-only entries using native CSS support now emit standalone stylesheets without an unnecessary JavaScript bundle. Standalone runtime chunks are also
CSS-only entries using native CSS support now emit standalone stylesheets without an unnecessary JavaScript bundle. Standalone runtime chunks are also omitted when no JavaScript entry needs them, making it easier to build CSS assets directly. See #14879.
Native CSS support now recognizes webpackIgnore and its rspackIgnore alias for @import, url(), and image-set() dependencies. This lets you leave selected references for the browser to load instead of resolving and bundling them. See #15314.
With experiments.newCache, parent and child compilers now coordinate access to shared persistent cache storage while keeping their entries separate. This prevents conflicting writes and cleanup from losing cached data, and allows both parent and child modules to be restored across compiler restarts. See #15616.
Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.2.3...v2.2.4
Rspack now supports asset, asset-url, and css-import external types, allowing CSS to reference stylesheets and assets hosted elsewhere. External @impo
Rspack now supports asset, asset-url, and css-import external types, allowing CSS to reference stylesheets and assets hosted elsewhere. External @import statements preserve layer, supports, and media conditions, so conditional styles stay conditional in the emitted CSS. #15431, #15522.
With experiments.nativeWatcher enabled, watchOptions.ignored now accepts a function, making it easier to reuse existing ignore rules when switching to the native watcher. File event processing has also been improved to reduce event loss during large bursts of changes on Linux. #15254.
Relative imports such as ./utils and ../shared no longer trigger unnecessary tsconfig loading or tracking of its project-reference tree. This reduces configuration reads and dependency tracking, especially in large TypeScript projects with many project references. #15492.
ignored option by @stormslowly in https://github.com/web-infra-dev/rspack/pull/15254swc_core from 77.0.0 to 77.1.2 by @tusharsingh308 in https://github.com/web-infra-dev/rspack/pull/15421Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.2.2...v2.2.3
feat(cache): add intrastructure logging to the new cache by @ahabhgk in https://github.com/web-infra-dev/rspack/pull/15338
Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.2.1...v2.2.2
The names introduced in 2.2.0 remain available as deprecated compatibility aliases, but we recommend upgrading to Rspack 2.2.1 and using the corrected…
compact-hashed IDs namingRspack 2.2.0 introduced compact hashed module and chunk IDs under the mistakenly named compat-hashed option and CompatHashedModuleIdsPlugin / CompatHashedChunkIdsPlugin APIs. Rspack 2.2.1 corrects these names to compact-hashed, CompactHashedModuleIdsPlugin, and CompactHashedChunkIdsPlugin.
The names introduced in 2.2.0 remain available as deprecated compatibility aliases, but we recommend upgrading to Rspack 2.2.1 and using the corrected names:
module.exports = {
optimization: {
moduleIds: 'compact-hashed',
chunkIds: 'compact-hashed',
},
};
Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.2.0...v2.2.1
feat: implement generation-based memory cache eviction by @ahabhgk in https://github.com/web-infra-dev/rspack/pull/15181
Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.1.10...v2.2.0
feat: integrate module code generation to the new cache by @ahabhgk in https://github.com/web-infra-dev/rspack/pull/15194
Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.2.0-beta.1...v2.2.0-rc.0
This is a breaking change for RSC framework integrations. Upgrade react-server-dom-rspack to 0.1.0 and update any code that relies on the previous exp…
Rspack now emits Client Component exports as registered client references directly. CSS imported by a Client Component is no longer injected by wrapping its exports with generated <link> elements; the stylesheet is preinitialized from the React Flight payload instead. This preserves client-reference identity, including default, named, CommonJS, and non-component exports. Explicit link generation remains available through import.meta.rspackRsc.loadCss().
This is a breaking change for RSC framework integrations. Upgrade react-server-dom-rspack to 0.1.0 and update any code that relies on the previous export-wrapper behavior.
swc_core is upgraded from 76 to 77, which changes the serialized AST encoding across the SWC Wasm plugin boundary. Plugins compiled against an earlier SWC schema no longer load and the build fails with The version of the SWC Wasm plugin you're using might not be compatible with 'builtin:swc-loader'. Rebuild your plugin, or upgrade to an SWC 77 compatible release .
Use plugins.swc.rs to find the plugin version matching your Rspack release, and see SWC plugin version mismatch for details. SWC 77 also introduces dedicated FunctionBody and ArrowFunctionBody::FunctionBody AST nodes, a breaking change for Rust-side consumers of the SWC AST.
CSS identifier escaping and unescaping now follow the CSS Syntax standard, so Unicode identifiers are emitted directly instead of carrying unnecessary backslashes.
.😍 {
color: red;
}
now generates .style_modules_css-😍 rather than .style_modules_css-\😍.
CSS Modules coverage also expands to more webpack cases — local/global modes, generator options, ICSS @value, custom identifiers, and warning order — and dependency collection moves into css-module-lexer, so stylesheets are no longer rescanned with regular expressions after parsing.
Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.1.10...v2.2.0-beta.1
Nothing published for this version
> Removed noisy `import.meta` warnings
[!NOTE] Removed noisy
import.metawarningsRspack 2.1.9 introduced warnings for unknown
import.metaproperties. Because they proved overly noisy in real-world builds, Rspack 2.1.10 removes them to reduce unnecessary diagnostics for custom or runtime-specific extensions. See #15166 for detail.
new URL targets in new-url-relative mode by @elecmonkey in https://github.com/web-infra-dev/rspack/pull/15155context from loaded config by @stormslowly in https://github.com/web-infra-dev/rspack/pull/15162Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.1.9...v2.1.10
feat: warn on unknown import.meta properties by @intellild in https://github.com/web-infra-dev/rspack/pull/14785
swc_core from 72 to 76 by @CPunisher in https://github.com/web-infra-dev/rspack/pull/15122Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.1.8...v2.1.9
Rspack now supports cache.name and cache.storage.location, aligning with webpack's persistent cache semantics. cache.storage.directory is now the base
Rspack now supports cache.name and cache.storage.location, aligning with webpack's persistent cache semantics. cache.storage.directory is now the base directory, while the final cache location defaults to <directory>/<cache.name>. Default cache paths remain unchanged.
If you previously used storage.directory as the exact cache path, migrate it to storage.location. Existing cache data is not migrated automatically.
cache: {
type: 'persistent',
storage: {
type: 'filesystem',
- directory: '/custom/cache',
+ location: '/custom/cache',
},
}
Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.1.7...v2.1.8
> Notice: The import.meta.env experimental feature introduced in Rspack 2.1.6 has been removed in Rspack 2.1.7.
Notice: The
import.meta.envexperimental feature introduced in Rspack 2.1.6 has been removed in Rspack 2.1.7.
Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.1.6...v2.1.7
feat: support import.meta.env by @intellild in https://github.com/web-infra-dev/rspack/pull/14483
Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.1.5...v2.1.6
fix: respect runtime mode in mf identifiers by @LingyuCoder in https://github.com/web-infra-dev/rspack/pull/14782
Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.1.4...v2.1.5
module.parser.javascript.importMeta now accepts an object so each known import.meta property can be configured independently, on top of the existing t
import.meta parser optionsmodule.parser.javascript.importMeta now accepts an object so each known import.meta property can be configured independently, on top of the existing true / false / 'preserve-unknown' values. Properties set to false are preserved for runtime evaluation, omitted properties keep their default behavior, and unknown properties are preserved. Both webpack-compatible keys (dirname, filename, main, url, webpack, webpackContext) and Rspack-specific keys (rspackHash, rspackPublicPath, glob, ...) are supported.
export default {
module: {
parser: {
javascript: {
importMeta: {
// keep `import.meta.url` for runtime evaluation
url: false,
// keep the compile-time replacement of `import.meta.webpack`
webpack: true,
},
},
},
},
};
module.parser.javascript.worker now accepts an object form with alias and url, alongside the existing boolean and string[] forms. With url: 'new-url-relative' and output.module enabled, Rspack emits a static new URL() expression for new Worker(new URL(..., import.meta.url)) instead of runtime code, honoring output.publicPath and output.workerPublicPath.
export default {
output: {
module: true,
chunkFilename: '[name].bundle.js',
},
module: {
parser: {
javascript: {
worker: {
url: 'new-url-relative',
},
},
},
},
};
new Worker(new URL('./worker.js', import.meta.url));
// would become 👇
new Worker(new URL('./worker.bundle.js', import.meta.url));
Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.1.3...v2.1.4
feat: add name/value accessors to ESMExportSpecifierDependency (#14641 by @yashwanth195)
Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.1.2...v2.1.3
<!-- obsidian --> Rspack now exposes more module variables through import.meta , which aligns better with the ESM specification than CommonJS-style in
import.meta style module variables<!-- obsidian --><p>Rspack now exposes more module variables through <code>import.meta</code>, which aligns better with the ESM specification than CommonJS-style injected globals. When authoring ESM modules, <code>import.meta</code> is now the recommended way to access these runtime values.</p> <p>The newly supported <code>import.meta</code> properties are:</p>
| New import.meta API | Existing runtime variable |
|---|---|
import.meta.rspackPublicPath |
__webpack_public_path__ |
import.meta.rspackBaseUri |
__webpack_base_uri__ |
import.meta.rspackShareScopes |
__webpack_share_scopes__ |
import.meta.rspackInitSharing |
__webpack_init_sharing__ |
import.meta.rspackNonce |
__webpack_nonce__ |
import.meta.rspackUniqueId |
__rspack_unique_id__ |
import.meta.rspackVersion |
__rspack_version__ |
import.meta.rspackHash |
__webpack_hash__ |
import.meta style module variables (#14539 by @LingyuCoder)Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.1.1...v2.1.2
feat(rsdoctor): add dependencyId and loc to export usage edges by @JSerFeng in https://github.com/web-infra-dev/rspack/pull/14577
Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.1.0...v2.1.1
feat: expose module error JS API by @SyMind in https://github.com/web-infra-dev/rspack/pull/14351
getProvidedExports() to JS API by @logonoff in https://github.com/web-infra-dev/rspack/pull/14349in on ESM imports by @ahabhgk in https://github.com/web-infra-dev/rspack/pull/14426maxGenerations to maxVersions by @ahabhgk in https://github.com/web-infra-dev/rspack/pull/14545overrideStrict for ContextModule by @colinaaa in https://github.com/web-infra-dev/rspack/pull/14361dim() in graphical renderer by @ruanyl in https://github.com/web-infra-dev/rspack/pull/14561Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.0.8...v2.1.0
feat: make persistent cache max generations default to 3 by @ahabhgk in https://github.com/web-infra-dev/rspack/pull/14534
Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.1.0-beta.0...v2.1.0-rc.0
React projects can now use React Compiler directly through Rspack's built-in SWC loader. See the React Compiler guide for details.
builtin:swc-loaderReact projects can now use React Compiler directly through Rspack's built-in SWC loader. See the React Compiler guide for details.
export default {
module: {
rules: [
{
test: /\.[cm]?[jt]sx?$/,
loader: 'builtin:swc-loader',
options: {
jsc: {
transform: {
reactCompiler: true,
},
},
},
},
],
},
};
Rspack's side-effect-free function analysis is now enabled by default in production builds. It can detect pure function calls through the #__NO_SIDE_EFFECTS__ notation and pureFunctions configuration, including exported functions across module boundaries. When the returned value is unused, Rspack can remove the call more reliably and improve tree shaking results without extra configuration. See experiments.pureFunctions for details.
// lib.js
/*@__NO_SIDE_EFFECTS__*/
export function call() {
console.log('hi')
}
// barrel.js
import { call } from './lib'
const value = call()
// if value is unused, call can be removed
export { value }
<img width="873" height="479" alt="image" src="https://github.com/user-attachments/assets/44b3e233-18cc-4be0-b3b1-a1697c649424" />
getProvidedExports() to JS API by @logonoff in https://github.com/web-infra-dev/rspack/pull/14349in on ESM imports by @ahabhgk in https://github.com/web-infra-dev/rspack/pull/14426overrideStrict for ContextModule by @colinaaa in https://github.com/web-infra-dev/rspack/pull/14361Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.0.8...v2.1.0-beta.0
fix: temporarily revert JS parser changes causing runtime errors by @CPunisher in https://github.com/web-infra-dev/rspack/pull/14343
Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.0.7...v2.0.8
> v2.0.7 has been deprecated because it may generate incorrect Rspack build outputs.
[!WARNING] v2.0.7 has been deprecated because it may generate incorrect Rspack build outputs.
Please do not install or use v2.0.7. Upgrade to v2.0.8 instead, which was released as the fix for this issue.
container, function, grid and pure by @intellild in https://github.com/web-infra-dev/rspack/pull/14189output.library.type: 'jsonp' by @logonoff in https://github.com/web-infra-dev/rspack/pull/14278Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.0.6...v2.0.7
RSC builds now validate the server-only and client-only marker packages. Importing a client-only module from a server-graph module (or a server-only m
server-only / client-only boundariesRSC builds now validate the server-only and client-only marker packages. Importing a client-only module from a server-graph module (or a server-only module from a client-graph module) is reported as a diagnostic. This marker-package validation always runs and is independent of disableClientApiChecks, which now only scopes the React client-API checks.
// server component (server graph)
import 'client-only'; // ❌ reported: client-only imported in a server module
// client component (client graph)
import 'server-only'; // ❌ reported: server-only imported in a client module
DeterministicModuleIdsPluginThe webpack-compatible deterministic module id plugin is now exposed through the JS API as rspack.ids.DeterministicModuleIdsPlugin, giving you fine-grained control over module ids for long-term caching. It supports the webpack options test, maxLength, salt, fixedLength, and failOnConflict.
const rspack = require('@rspack/core');
module.exports = {
optimization: { moduleIds: false },
plugins: [
new rspack.ids.DeterministicModuleIdsPlugin({
maxLength: 5,
failOnConflict: true,
}),
],
};
composes cascade orderCSS Modules now use a shared topological sort to keep the source order of composes, so composed declarations land in the output cascade in the order you authored them. This fixes subtle specificity surprises when composing local class names across modules.
swc_exp and swc_core from 66 to 68 by @CPunisher in https://github.com/web-infra-dev/rspack/pull/14241Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.0.5...v2.0.6
Rspack now supports import.meta.glob, a file-system import API already available in Vite and Turbopack. We chose to align with this ecosystem behavior
import.meta.globRspack now supports import.meta.glob, a file-system import API already available in Vite and Turbopack. We chose to align with this ecosystem behavior.
const pages = import.meta.glob('./pages/**/*.tsx', {
eager: true,
import: 'default',
query: { layout: 'docs' },
base: './pages',
});
CSS modules can now control parsing for @import, animations, custom idents, and dashed idents through module.parser, so projects can match existing CSS Modules behavior more closely while migrating to Rspack.
export default {
module: {
parser: {
'css/module': {
import: true,
animation: true,
customIdents: true,
dashedIdents: true,
},
},
},
};
Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.0.4...v2.0.5
Inline const with module declarations (#14032): Previously, Rspack only inlined constant exports from leaf modules in the module graph. Now constant e
Inline const with module declarations (#14032): Previously, Rspack only inlined constant exports from leaf modules in the module graph. Now constant exports from any module can be inlined, even when that module also imports or re-exports other modules. In rare circular-reference cases this can make a TDZ error disappear, but we do not expect real projects to rely on TDZ errors, so Rspack prioritizes the optimization.
// constants.js
import './setup';
export const ENABLE_EXPERIMENT = false;
// entry.js
import { ENABLE_EXPERIMENT } from './constants';
if (ENABLE_EXPERIMENT) {
runExperiment();
}
// Before: constants.js is not a leaf module, so the branch could keep
// reading the imported binding.
if (ENABLE_EXPERIMENT) {
runExperiment();
}
// Now: the constant can still be inlined, so dead branches are easier
// to remove.
if (false) {
runExperiment();
}
Tree shake namespace default reexport (#13980): Previously, the import * as a from './a'; export default a; pattern did not tree-shake a through the default export. Now Rspack further analyzes the default-exported namespace object and can remove unused exports from the original namespace module.
// a.js
export function used() {}
export function unused() {}
// bridge.js
import * as a from './a';
export default a;
// app.js
import a from './bridge';
a.used();
// Before: both used and unused could be kept in the bundle.
// Now: unused can be tree-shaken.
CSS global module type (#13988): css/global is useful when most selectors in a stylesheet should stay global, but you still want CSS Modules features for selected local selectors. This makes it easier to migrate existing global CSS gradually without turning every class name into a local scoped name.
export default {
module: {
rules: [{ test: /\.global\.css$/i, type: 'css/global' }],
},
};
/* style.global.css */
.button {
color: red;
}
:local(.title) {
font-weight: 600;
}
.button stays global, while .title is renamed as a local class.
CSS Modules local ident options (#14009): CSS Modules now support local ident hash options such as hash function, digest, digest length, and salt. These options make generated class names more configurable and better aligned with webpack-compatible CSS Modules setups.
export default {
module: {
rules: [{ test: /\.module\.css$/i, type: 'css/module' }],
generator: {
'css/module': {
localIdentName: '[name]__[local]__[hash]',
localIdentHashFunction: 'xxhash64',
localIdentHashDigest: 'hex',
localIdentHashDigestLength: 8,
localIdentHashSalt: 'my-salt',
},
},
},
};
Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.0.3...v2.0.4
<!-- Release notes generated using configuration in .github/release.yml at v2.0.3 -->
<!-- Release notes generated using configuration in .github/release.yml at v2.0.3 -->
Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.0.2...v2.0.3
<!-- Release notes generated using configuration in .github/release.yml at v2.0.2 -->
<!-- Release notes generated using configuration in .github/release.yml at v2.0.2 -->
Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.0.1...v2.0.2
<!-- Release notes generated using configuration in .github/release.yml at v2.0.1 -->
<!-- Release notes generated using configuration in .github/release.yml at v2.0.1 -->
Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.0.0...v2.0.1
feat!: remove deprecated WarnCaseSensitiveModulesPlugin by @LingyuCoder in https://github.com/web-infra-dev/rspack/pull/12737
<!-- Release notes generated using configuration in .github/release.yml at v2.0.0 -->
experiments.SubResourceIntegrityPlugin by @LingyuCoder in https://github.com/web-infra-dev/rspack/pull/12642experiments.rspackFuture and move bundlerInfo to output by @LingyuCoder in https://github.com/web-infra-dev/rspack/pull/12654experiments.parallelLoader by @LingyuCoder in https://github.com/web-infra-dev/rspack/pull/12658profile and stats.profile by @LingyuCoder in https://github.com/web-infra-dev/rspack/pull/12662verbatimModuleSyntax of builtin:swc-loader by default by @LingyuCoder in https://github.com/web-infra-dev/rspack/pull/12668rspack.experiments.lazyCompilationMiddleware by @LingyuCoder in https://github.com/web-infra-dev/rspack/pull/12736output.charset by @LingyuCoder in https://github.com/web-infra-dev/rspack/pull/12660.swcrc reading in JavaScript compiler by @CPunisher in https://github.com/web-infra-dev/rspack/pull/12667pnp_manifest option to resolver by @smeng9 in https://github.com/web-infra-dev/rspack/pull/12417optimization.removeAvailableModules config option by @JSerFeng in https://github.com/web-infra-dev/rspack/pull/13317rspack_browser crate and require @rspack/browser to run in a Worker by @CPunisher in https://github.com/web-infra-dev/rspack/pull/13712strictThisContextOnImports to control ns obj as this by @ahabhgk in https://github.com/web-infra-dev/rspack/pull/13234import.defer() for statical path by @ahabhgk in https://github.com/web-infra-dev/rspack/pull/12900beforeModuleIds hook by @hamlim in https://github.com/web-infra-dev/rspack/pull/12809import.defer() for context module by @ahabhgk in https://github.com/web-infra-dev/rspack/pull/12938resolveImport parser option for css parser to choose whether to resolve @import syntax by @JSerFeng in https://github.com/web-infra-dev/rspack/pull/12672devServer types for @rspack/dev-server v2 by @chenjiahan in https://github.com/web-infra-dev/rspack/pull/13278import.meta.main by @ahabhgk in https://github.com/web-infra-dev/rspack/pull/13489import.meta.resolve argument by @ahabhgk in https://github.com/web-infra-dev/rspack/pull/13523#/ subpath alias import by @stormslowly in https://github.com/web-infra-dev/rspack/pull/13633@rspack/browser failure after pure esm transformation by @Timeless0911 in https://github.com/web-infra-dev/rspack/pull/12781rstest.importActual not work when imported from @rstest/core by @9aoy in https://github.com/web-infra-dev/rspack/pull/12908is_available_chunk when chunk groups form a cycle by @SyMind in https://github.com/web-infra-dev/rspack/pull/13042@rspack/lite-tapable by @colinaaa in https://github.com/web-infra-dev/rspack/pull/13048mockRequire to rstest_mock_require by @9aoy in https://github.com/web-infra-dev/rspack/pull/13056import.meta.resolve() and add tests by @ahabhgk in https://github.com/web-infra-dev/rspack/pull/13469recursiron_directories to recurse_parent_directories by @jaehafe in https://github.com/web-infra-dev/rspack/pull/13510@emnapi/core and @emnapi/runtime as dependencies by @CPunisher in https://github.com/web-infra-dev/rspack/pull/13665SourceSizeCache for module size cache by @CPunisher in https://github.com/web-infra-dev/rspack/pull/13258BasicEvaluatedExpression by @CPunisher in https://github.com/web-infra-dev/rspack/pull/13265swc_node_comments by @CPunisher in https://github.com/web-infra-dev/rspack/pull/13470boolean type by @9aoy in https://github.com/web-infra-dev/rspack/pull/12824optimization.mangleExports docs by @chenjiahan in https://github.com/web-infra-dev/rspack/pull/13018readResourceForScheme hook by @chenjiahan in https://github.com/web-infra-dev/rspack/pull/13365builtin:swc-loader by @CPunisher in https://github.com/web-infra-dev/rspack/pull/13366import.meta docs by @ahabhgk in https://github.com/web-infra-dev/rspack/pull/13574-production bench cases by @CPunisher in https://github.com/web-infra-dev/rspack/pull/13125swc_core from 56 to 58 by @CPunisher in https://github.com/web-infra-dev/rspack/pull/13164swc_core from 58 to 59 by @CPunisher in https://github.com/web-infra-dev/rspack/pull/13434-Zfmt-debug=none for non-browser wasm target by @CPunisher in https://github.com/web-infra-dev/rspack/pull/13527-Zfmt-debug=none by @CPunisher in https://github.com/web-infra-dev/rspack/pull/13540useNapiCross for x64 linux gnu compilation by @CPunisher in https://github.com/web-infra-dev/rspack/pull/13539@rspack/cli, @rspack/tests tests sequentially in wasm by @CPunisher in https://github.com/web-infra-dev/rspack/pull/13557swc_core from 59 to 62 by @CPunisher in https://github.com/web-infra-dev/rspack/pull/13602beforeModuleIds hook by @hamlim in https://github.com/web-infra-dev/rspack/pull/13222Note truncated.
<!-- Release notes generated using configuration in .github/release.yml at v2.0.0-rc.3 -->
<!-- Release notes generated using configuration in .github/release.yml at v2.0.0-rc.3 -->
rspack_browser crate and require @rspack/browser to run in a Worker by @CPunisher in https://github.com/web-infra-dev/rspack/pull/13712Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.0.0-rc.2...v2.0.0-rc.3
<!-- Release notes generated using configuration in .github/release.yml at v2.0.0-rc.2 -->
<!-- Release notes generated using configuration in .github/release.yml at v2.0.0-rc.2 -->
#/ subpath alias import by @stormslowly in https://github.com/web-infra-dev/rspack/pull/13633@emnapi/core and @emnapi/runtime as dependencies by @CPunisher in https://github.com/web-infra-dev/rspack/pull/13665beforeModuleIds hook by @hamlim in https://github.com/web-infra-dev/rspack/pull/13222Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.0.0-rc.1...v2.0.0-rc.2
<!-- Release notes generated using configuration in .github/release.yml at v2.0.0-rc.1 -->
<!-- Release notes generated using configuration in .github/release.yml at v2.0.0-rc.1 -->
Rspack can now detect side-effect-free function calls through the #__NO_SIDE_EFFECTS__ notation and manual pureFunctions hints. With support for exported functions and cross-module analysis, unused calls can be identified more reliably, improving tree shaking results and making it easier to optimize both application code and third-party dependencies.
// lib.js
/*@__NO_SIDE_EFFECTS__*/
export function call() {
console.log('hi')
}
// barrel.js
import { call } from './lib'
const value = call()
// if value is unused, call can be removed
export { value }
<img width="873" height="479" alt="image" src="https://github.com/user-attachments/assets/44b3e233-18cc-4be0-b3b1-a1697c649424" />
import.meta docs by @ahabhgk in https://github.com/web-infra-dev/rspack/pull/13574@rspack/cli, @rspack/tests tests sequentially in wasm by @CPunisher in https://github.com/web-infra-dev/rspack/pull/13557swc_core from 59 to 62 by @CPunisher in https://github.com/web-infra-dev/rspack/pull/13602Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.0.0-rc.0...v2.0.0-rc.1
<!-- Release notes generated using configuration in .github/release.yml at v2.0.0-rc.0 -->
<!-- Release notes generated using configuration in .github/release.yml at v2.0.0-rc.0 -->
import.meta.mainimport.meta.main is a boolean flag used in ES modules to determine whether the current module is the program’s entry module. It evaluates to true when the module is executed as the main entry, and to false when it is imported by another module. You can think of it as the ESM equivalent of require.main === module in CommonJS. It is useful for running startup logic, initialization code, or CLI behavior only when a module is launched directly.
import.meta.main by @ahabhgk in https://github.com/web-infra-dev/rspack/pull/13489import.meta.resolve argument by @ahabhgk in https://github.com/web-infra-dev/rspack/pull/13523recursiron_directories to recurse_parent_directories by @jaehafe in https://github.com/web-infra-dev/rspack/pull/13510-Zfmt-debug=none for non-browser wasm target by @CPunisher in https://github.com/web-infra-dev/rspack/pull/13527-Zfmt-debug=none by @CPunisher in https://github.com/web-infra-dev/rspack/pull/13540useNapiCross for x64 linux gnu compilation by @CPunisher in https://github.com/web-infra-dev/rspack/pull/13539Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.0.0-beta.9...v2.0.0-rc.0
Nothing published for this version
Nothing published for this version
<!-- Release notes generated using configuration in .github/release.yml at v2.0.0-beta.9 -->
<!-- Release notes generated using configuration in .github/release.yml at v2.0.0-beta.9 -->
import.meta.resolve() and add tests by @ahabhgk in https://github.com/web-infra-dev/rspack/pull/13469swc_node_comments by @CPunisher in https://github.com/web-infra-dev/rspack/pull/13470Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.0.0-beta.8...v2.0.0-beta.9
chore: remove old deprecated code of ModernModuleLibraryPlugin by @JSerFeng in https://github.com/web-infra-dev/rspack/pull/13318
<!-- Release notes generated using configuration in .github/release.yml at v2.0.0-beta.8 -->
swc_core from 58 to 59 by @CPunisher in https://github.com/web-infra-dev/rspack/pull/13434Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.0.0-beta.7...v2.0.0-beta.8
<!-- Release notes generated using configuration in .github/release.yml at v2.0.0-beta.7 -->
<!-- Release notes generated using configuration in .github/release.yml at v2.0.0-beta.7 -->
optimization.removeAvailableModules config option by @JSerFeng in https://github.com/web-infra-dev/rspack/pull/13317BasicEvaluatedExpression by @CPunisher in https://github.com/web-infra-dev/rspack/pull/13265readResourceForScheme hook by @chenjiahan in https://github.com/web-infra-dev/rspack/pull/13365builtin:swc-loader by @CPunisher in https://github.com/web-infra-dev/rspack/pull/13366Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.0.0-beta.6...v2.0.0-beta.7
<!-- Release notes generated using configuration in .github/release.yml at v2.0.0-beta.6 -->
<!-- Release notes generated using configuration in .github/release.yml at v2.0.0-beta.6 -->
devServer types for @rspack/dev-server v2 by @chenjiahan in https://github.com/web-infra-dev/rspack/pull/13278SourceSizeCache for module size cache by @CPunisher in https://github.com/web-infra-dev/rspack/pull/13258strictThisContextOnImports to control ns obj as this by @ahabhgk in https://github.com/web-infra-dev/rspack/pull/13234Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.0.0-beta.5...v2.0.0-beta.6
<!-- Release notes generated using configuration in .github/release.yml at v2.0.0-beta.5 -->
<!-- Release notes generated using configuration in .github/release.yml at v2.0.0-beta.5 -->
swc_core from 56 to 58 by @CPunisher in https://github.com/web-infra-dev/rspack/pull/13164Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.0.0-beta.4...v2.0.0-beta.5
<!-- Release notes generated using configuration in .github/release.yml at v2.0.0-beta.4 -->
<!-- Release notes generated using configuration in .github/release.yml at v2.0.0-beta.4 -->
-production bench cases by @CPunisher in https://github.com/web-infra-dev/rspack/pull/13125Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.0.0-beta.3...v2.0.0-beta.4
<!-- Release notes generated using configuration in .github/release.yml at v2.0.0-beta.3 -->
<!-- Release notes generated using configuration in .github/release.yml at v2.0.0-beta.3 -->
pnp_manifest option to resolver by @smeng9 in https://github.com/web-infra-dev/rspack/pull/12417is_available_chunk when chunk groups form a cycle by @SyMind in https://github.com/web-infra-dev/rspack/pull/13042@rspack/lite-tapable by @colinaaa in https://github.com/web-infra-dev/rspack/pull/13048mockRequire to rstest_mock_require by @9aoy in https://github.com/web-infra-dev/rspack/pull/13056Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.0.0-beta.2...v2.0.0-beta.3
fix!: remove deprecated readResourceForScheme hook by @chenjiahan in https://github.com/web-infra-dev/rspack/pull/13027
<!-- Release notes generated using configuration in .github/release.yml at v2.0.0-beta.2 -->
Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.0.0-beta.1...v2.0.0-beta.2
docs: move deprecated options to dedicated page by @chenjiahan in https://github.com/web-infra-dev/rspack/pull/12953
<!-- Release notes generated using configuration in .github/release.yml at v2.0.0-beta.1 -->
beforeModuleIds hook by @hamlim in https://github.com/web-infra-dev/rspack/pull/12809import.defer() for context module by @ahabhgk in https://github.com/web-infra-dev/rspack/pull/12938resolveImport parser option for css parser to choose whether to resolve @import syntax by @JSerFeng in https://github.com/web-infra-dev/rspack/pull/12672optimization.mangleExports docs by @chenjiahan in https://github.com/web-infra-dev/rspack/pull/13018Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.0.0-beta.0...v2.0.0-beta.1
<!-- Release notes generated using configuration in .github/release.yml at v2.0.0-beta.0 -->
<!-- Release notes generated using configuration in .github/release.yml at v2.0.0-beta.0 -->
import.defer() for statical path by @ahabhgk in https://github.com/web-infra-dev/rspack/pull/12900rstest.importActual not work when imported from @rstest/core by @9aoy in https://github.com/web-infra-dev/rspack/pull/12908Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.0.0-alpha.1...v2.0.0-beta.0
<!-- Release notes generated using configuration in .github/release.yml at v2.0.0-alpha.1 -->
<!-- Release notes generated using configuration in .github/release.yml at v2.0.0-alpha.1 -->
<!-- ## Highlights 💡 -->
boolean type by @9aoy in https://github.com/web-infra-dev/rspack/pull/12824Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.0.0-alpha.0...v2.0.0-alpha.1
This is an early preview release intended for testing only. It introduces a number of breaking changes that are not yet final.
<!-- Release notes generated using configuration in .github/release.yml at v2.0.0-alpha.0 -->
This is an early preview release intended for testing only. It introduces a number of breaking changes that are not yet final.
See https://github.com/web-infra-dev/rspack/discussions/9270 for all breaking changes.
experiments.SubResourceIntegrityPlugin by @LingyuCoder in https://github.com/web-infra-dev/rspack/pull/12642experiments.rspackFuture and move bundlerInfo to output by @LingyuCoder in https://github.com/web-infra-dev/rspack/pull/12654experiments.parallelLoader by @LingyuCoder in https://github.com/web-infra-dev/rspack/pull/12658profile and stats.profile by @LingyuCoder in https://github.com/web-infra-dev/rspack/pull/12662verbatimModuleSyntax of builtin:swc-loader by default by @LingyuCoder in https://github.com/web-infra-dev/rspack/pull/12668rspack.experiments.lazyCompilationMiddleware by @LingyuCoder in https://github.com/web-infra-dev/rspack/pull/12736output.charset by @LingyuCoder in https://github.com/web-infra-dev/rspack/pull/12660.swcrc reading in JavaScript compiler by @CPunisher in https://github.com/web-infra-dev/rspack/pull/12667@rspack/browser failure after pure esm transformation by @Timeless0911 in https://github.com/web-infra-dev/rspack/pull/12781Full Changelog: https://github.com/web-infra-dev/rspack/compare/v1.7.3...v2.0.0-alpha.0
<!-- Release notes generated using configuration in .github/release.yml at v1.7.12 -->
<!-- Release notes generated using configuration in .github/release.yml at v1.7.12 -->
Full Changelog: https://github.com/web-infra-dev/rspack/compare/v1.7.11...v1.7.12
One column per quarter.