What changed in rspack from 1 to 2

15 releases numbered after v1.7.12 up to and including v2.2.2, stable releases only. v1.7.12 and v2.2.2 are the newest stable releases of 1 and 2 we track; this page follows them as new ones ship.

199 changes across 15 releases · 9 landed on more than one version

Added 45

v2.2.2

  • Add infrastructure logging to the new cache
  • Add JavascriptModulesPlugin.getChunkFilenameTemplate

v2.2.1

  • Align wasmStreamingFallback with webpack
  • Track dependencies in loader cache

v2.2.0

  • Implement generation-based memory cache eviction
  • Add idle cache compaction with interruption handling
  • Integrate module code generation to the new cache
  • Add fine-grained new cache options
  • Add compat-hashed module ids
  • Analyze dynamic imports in Promise.all destructuring
  • Integrate new cache into source map devtool plugin
  • Add compilation.runtimeTemplate
  • Add compact chunk ids
  • Support opt-in per-loader caching

v2.1.10

  • Expose ExternalModule chunkCondition hook
  • Implement new cache system
  • Integrate new cache to minimize cache

v2.1.9

  • Warn on unknown import.meta properties
  • Add builds for binding-linux-(ppc64,s390x)-gnu
  • Support --no-git flag in create-rspack
  • Support caseSensitive option in import.meta.glob

v2.1.8

  • Support cache.name and cache.storage.location options to align with webpack's persistent cache semantics
  • Emit css.c and css.r in the hot-update manifest for precise CSS updates
  • Inject module origin for import.meta.rstest

v2.1.6

  • Support import.meta.env

v2.1.4

  • Support fine-grained import.meta parser options allowing each known import.meta property to be configured independently
  • Support static worker new URL output with module.parser.javascript.worker accepting an object form with alias and url
  • Support logical assignment for chunk loading global in runtime

v2.1.3

  • Add name/value accessors to ESMExportSpecifierDependency
  • Expose the real Chunk instance to filename functions

v2.1.2

  • Support `import.meta` style module variables including `import.meta.rspackPublicPath`, `import.meta.rspackBaseUri`, `import.meta.rspackShareScopes`, `import.meta.rspackInitSharing`, `import.meta.rspackNonce`, `import.meta.rspackUniqueId`, `import.meta.rspackVersion`, and `import.meta.rspackHash`

v2.1.1

  • Add dependencyId and loc to export usage edges in rsdoctor

v2.1.0

  • Expose module error JS APIalso inv2.1.0-beta.0
  • Log persistent cache read and write timingsalso inv2.1.0-beta.0
  • Expose getProvidedExports() to JS APIalso inv2.1.0-beta.0
  • Support drop inactive branch dependencies for member expressions
  • Introduce experimental.runtimeModealso inv2.1.0-beta.0
  • Support branch guarded export presence for `in` on ESM imports
  • Bump swc to support react compiler
  • Expose export usage graph to rsdoctor
  • Add maxAge and maxGenerations for persistent cache cleanupalso inv2.1.0-beta.0
  • Support riscv64 targets

v2.1.0-beta.0

  • Support React Compiler in builtin:swc-loader
  • Support drop inactive branch dependencies for member expr
  • Support branch guarded export presence for in on ESM imports
Changed 43

v2.2.2

  • Optimize deterministic module id assignment
  • Share runtimes in flag dependency usage
  • Optimize module rendering for chunk assets
  • Optimize create module hashes

v2.2.1

  • Store FactorizeInfo path dependencies as compact slices

v2.2.0

  • Improve unicode handling and support more CSS modules cases, boost performance
  • Cache converted module original source
  • Batch splitChunks JavaScript callbacks
  • Avoid parsing concatenated module codegen
  • Preallocate identifier path buffers
  • Intern ArcPath as a single-allocation prehashed path
  • Use rayon parallel scheduling for new cache db
  • Skip the directory walk for glob patterns without metacharacters

v2.1.9

  • Cache and order static patterns in copy-plugin
  • Limit incremental HMR asset processing
  • Avoid unnecessary call wrappers for runtime helpers
  • Cache compilation assets proxy
  • Avoid copying aligned archive buffers in cache
  • Avoid duplicating export dependency data in JSON
  • Improve source map convert performance

v2.1.8

  • cache.storage.directory is now the base directory, with final cache location defaulting to <directory>/<cache.name>

v2.1.7

  • Share source code across diagnostics to improve performance

v2.1.6

  • Cache module concatenation analysis across roots
  • Reuse module concatenation search state
  • Reduce module concatenation hot-path overhead

v2.1.4

  • Enable parallel wasmtime compilation for improved performance
  • Optimize ESM linking passes
  • Deduplicate repeated dynamic reexport code
  • Reduce hook macro expansion size and optimize performance

v2.1.3

  • Erase js tap storage types to reduce binary size
  • Build rspack source maps directly
  • Optimize module hash creation
  • Pre-size per-module maps and vecs in mangle_exports

v2.1.2

  • Deduplicate runtime module macro glue for improved performance
  • Avoid cloning side effects artifact in module concatenation

v2.1.1

  • Add persistent cache for SourceMapDevToolPlugin

v2.1.0

  • Enable pureFunctions by default
  • Make persistent cache max generations default to 3
  • Rename persistent cache maxGenerations to maxVersions
  • Harden persistent cache version cleanup with typed version
  • Make stale version cleanup fire-and-forget

v2.1.0-beta.0

  • Enable side-effect-free function analysis by default in production builds
  • Bump swc to support react compiler
Fixed 109

v2.2.2

  • Generate correct prefetch child assets
  • Keep import.meta.url in createRequire when importMeta is disabled
  • Align module need_build and FileSystemInfo with webpack
  • Support all EnvironmentPlugin default values
  • Improve incremental chunk graph reuse
  • Await patch delivery before sealing completes in rsdoctor
  • Ignore exportsOnly in local ident hashes for CSS
  • Fallback eval devtools for modern-module
  • Report diagnostics for unsupported context modes

v2.2.1

  • Correct compact hashed module and chunk IDs naming from compat-hashed to compact-hashed, with deprecated compatibility aliases maintained for backward compatibility
  • Disable stats logging by default
  • Disable incremental outside development mode
  • Run afterCompile before shouldEmit and asset emission
  • Clear stale issuer updates between rebuilds
  • Exclude asset output path from URLs in CSS
  • Bound concurrent asset writes during emit
  • Update swc_ecma_minifier to 61.0.4
  • Store server compiler ID in native coordinator
  • Persist dependency id in metadata
  • Normalize restored paths on Windows

v2.2.0

  • Pass HMR error to Preact refresh recovery handler
  • Strip BOM from module content before concatenation in CSS extraction

v2.1.10

  • Process remaining module copies at lower priorities in split-chunks
  • Allow scope hoisting for new URL targets in new-url-relative mode in esm_library
  • Bump rkyv to 0.8.18 to fix RUSTSEC-2026-0233, RUSTSEC-2026-0234, and RUSTSEC-2026-0235
  • Normalize string context from loaded config in CLI
  • Share ExternalModule hooks across core instances
  • Fix new cache compile failure on 32-bit platforms

v2.1.9

  • Improve circular real content hash error diagnostics
  • Keep compilation dependency iterators disjoint
  • Align cache version semantics with webpack
  • Preserve ignored URL when import.meta.url is disabled
  • Avoid runtime lock deadlock in napi
  • Match compiler prefixes exactly in lazy compilation
  • Avoid injecting shared providers into worker entrypoints in Module Federation
  • Handle optional chains in member hook traversal
  • Support loader context APIs in parallel loaders

v2.1.8

  • Preserve entry dependency identity in binding
  • Preserve Lightning CSS license comments in loader
  • Add missing CJS interop runtime requirement for ESM
  • Avoid dead require bootstrap in runtime
  • Preserve collision-free createRequire imports in runtime
  • Clean up compilation-scoped plugin caches
  • Hoist test API imports by source order in rstest
  • Release custom runtime module generators on close in binding
  • Preserve context exports in rspack runtime mode
  • Correct full-hash chunk filenames in runtime
  • Use POSIX asset keys in copy-plugin
  • Remove redundant runtime declarations
  • Handle SharedWorker string name option
  • Avoid runtime scope conflicts in module factories
  • Preserve direct exports bindings

v2.1.7

  • Release module graph connection wrappers

v2.1.6

  • Materialize namespace object for concatenated modules
  • Parse preserved createRequire arguments
  • Invalidate module hashes when assigning deterministic and natural ids
  • Disable incremental chunk assets for entry fullhash filenames
  • Propagate asset emit errors
  • Avoid JavaScript output for URL-only assets
  • Avoid worker external facade in bundleless output
  • Execute worker entry modules in modern-module output
  • Preserve defineConfig inference in CLI
  • Preserve structured swc diagnostics in swc-loader
  • Respect DllPlugin context for concatenated modules
  • Scope maxVersions by compiler using compilerPath in cache

v2.1.5

  • Respect runtime mode in mf identifiers
  • Preserve multiple referenced client exports in rsc
  • Preserve createRequire().resolve with literal import.meta.url when requireResolve is disabled
  • Preserve inline match resource imports in css
  • Short-circuit optional import.meta calls
  • Preserve exports for dynamic client references in rsc
  • Avoid live chunk access when serializing stale stats
  • Register hoisted mocks before importActual imports in rstest
  • Run FsWatcher on a single owner task to fix concurrent &mut races
  • Add module type when options are omitted in module output for worker
  • Include output path in chunk render cache keys
  • Support real content hash update hooks

v2.1.4

  • Clean up runtime global rendering
  • Clean up chunk wrappers when compiler is garbage collected
  • Enable runtime mode ESM context imports
  • Revert Module Federation runtime identifiers
  • Include paths in native filesystem errors
  • Respect RSPACK_BINDING in loader workers
  • Invalidate the target compiler for lazy compilation

v2.1.3

  • Update runtime context during hot updates
  • Inline-value check must precede deferred pure checks in concatenation
  • Skip re-applying unchanged CSS during HMR
  • Preserve asset bytes for binary files
  • Dedupe link HMR stylesheets in CSS
  • Emit manifest assets with forward-slash names on Windows
  • Unwrap dynamic source-phase imports in modern-module output
  • Preserve static source-phase external bindings in esm_library
  • Distinguish css wrapper sourcemap names
  • Keep path data chunk compatible in binding

v2.1.2

  • Inject runtime require into browser MF runtime
  • Preserve import phase in dynamic import external rendering
  • Empty references export for cjs and dynamic import tree shaking

v2.1.1

  • Add guard for link.parentNode in css runtime
  • Revert cjs export assignment side effects optimization

v2.1.0

  • Preserve inline source content for transform sourcemapsalso inv2.1.0-beta.0
  • Remove webpackSource and webpackDefer magic commentsalso inv2.1.0-beta.0
  • Apply global overrideStrict for ContextModulealso inv2.1.0-beta.0
  • Filter ignored-subtree events that emit a spurious folder change in watcher
  • Handle nested pure function calls in tree-shakingalso inv2.1.0-beta.0

v2.1.0-beta.0

  • Filter ignored-subtree events that emit a spurious folder change
  • Use ChunkWithSizeInfo delimiter in maxInitialSize chunk naming fallback path
  • Wait for in-flight build before closing compiler
  • Point wasi-worker-browser export to dist file
  • Cache import.meta filename and dirname outside eval
Removed 2

v2.1.10

  • Remove noisy import.meta warnings for unknown properties

v2.1.7

  • Remove the import.meta.env experimental feature that was introduced in Rspack 2.1.6

Original release notes, newest first

The list above is our reading of these notes; the originals from rspack are here, one fold per release.

v2.2.2
What's Changed
New Features 🎉
Performance 🚀
Bug Fixes 🐞
Refactor 🔨
Document 📖
Other Changes
New Contributors

Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.2.1...v2.2.2

View originalPermalink

v2.2.1
Highlights
Corrected compact-hashed IDs naming

Rspack 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',
  },
};
What's Changed
New Features 🎉
Performance 🚀
Bug Fixes 🐞
Refactor 🔨
Document 📖
Other Changes
New Contributors

Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.2.0...v2.2.1

View originalPermalink

v2.2.0
What's Changed
🎉 See Announcing Rspack 2.2 for more details.
New Features 🎉
Performance 🚀
Bug Fixes 🐞
Refactor 🔨
Document 📖
Other Changes
New Contributors

Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.1.10...v2.2.0

View originalPermalink

v2.1.10

[!NOTE] Removed noisy import.meta warnings

Rspack 2.1.9 introduced warnings for unknown import.meta properties. 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.

What's Changed
New Features 🎉
Bug Fixes 🐞
Refactor 🔨
Document 📖
Other Changes
New Contributors

Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.1.9...v2.1.10

View originalPermalink

v2.1.9
What's Changed
New Features 🎉
Performance 🚀
Bug Fixes 🐞
Refactor 🔨
Document 📖
Other Changes
New Contributors

Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.1.8...v2.1.9

View originalPermalink

v2.1.8
Highlights
Persistent cache storage options now align with webpack

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',
  },
}
What's Changed
New Features 🎉
Performance 🚀
Bug Fixes 🐞
Refactor 🔨
Document 📖
Other Changes
New Contributors

Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.1.7...v2.1.8

View originalPermalink

v2.1.7

Notice: The import.meta.env experimental feature introduced in Rspack 2.1.6 has been removed in Rspack 2.1.7.

What's Changed
Performance 🚀
Bug Fixes 🐞
Other Changes

Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.1.6...v2.1.7

View originalPermalink

v2.1.6
What's Changed
New Features 🎉
Performance 🚀
Bug Fixes 🐞
Refactor 🔨
Document 📖
Other Changes
New Contributors

Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.1.5...v2.1.6

View originalPermalink

v2.1.5
What's Changed
Bug Fixes 🐞
Refactor 🔨
Other Changes

Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.1.4...v2.1.5

View originalPermalink

v2.1.4
Highlights
Fine-grained import.meta parser options

module.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,
        },
      },
    },
  },
};
Static worker URL output

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));
What's Changed
New Features 🎉
Performance 🚀
Bug Fixes 🐞
Refactor 🔨
Other Changes
New Contributors

Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.1.3...v2.1.4

View originalPermalink

v2.1.3
What's Changed
New Features 🎉
  • feat: add name/value accessors to ESMExportSpecifierDependency (#14641 by @yashwanth195)
  • feat(core): expose the real Chunk instance to filename functions (#14549 by @JSerFeng)
Performance 🚀
  • perf: erase js tap storage types to reduce binary size (#14636 by @intellild)
  • perf: build rspack source maps directly (#14621 by @intellild)
  • perf: optimize module hash creation (#14654 by @LingyuCoder)
  • perf(mangle_exports): pre-size per-module maps and vecs (#14705 by @stormslowly)
Bug Fixes 🐞
  • fix: update runtime context during hot updates (#14644 by @LingyuCoder)
  • fix(concatenation): inline-value check must precede deferred pure checks (#14663 by @guru-irl)
  • fix(css): skip re-applying unchanged CSS during HMR (#14580 by @stormslowly)
  • fix(asset): preserve asset bytes for binary files (#14670 by @hardfist)
  • fix(css): dedupe link HMR stylesheets (#14666 by @intellild)
  • fix(mf): emit manifest assets with forward-slash names on Windows (#14667 by @johncarmack1984)
  • fix(esm_library): unwrap dynamic source-phase imports in modern-module output (#14673 by @elecmonkey)
  • fix(esm_library): preserve static source-phase external bindings (#14674 by @elecmonkey)
  • fix(bench): pin glibc string-func dispatch to stabilize simulation benches (#14704 by @stormslowly)
  • fix(css): distinguish css wrapper sourcemap names (#14675 by @intellild)
  • fix(binding): keep path data chunk compatible (#14698 by @JSerFeng)
Refactor 🔨
  • refactor: use rspack runtime module prefix (#14630 by @LingyuCoder)
  • refactor: split content hash from std Hash (#14384 by @intellild)
  • refactor: rename hash objects for clearer semantics (#14642 by @intellild)
  • refactor: use rspack scheme for source map defaults (#14635 by @LingyuCoder)
  • refactor(runtime): collect runtime writes from ejs define (#14651 by @LingyuCoder)
  • refactor(napi): remove napi tokio runtime dependency (#14696 by @hardfist)
Other Changes
  • test: register misc bundle benchmark (#14632 by @hardfist)
  • chore(release): stream per-package publish output (#14585 by @stormslowly)
  • chore(deps): update github-actions (#14638 by @renovate[bot])
  • ci: replace rust-cache with sccache (TOS) on self-hosted runners (#14567 by @stormslowly)
  • ci: reset lynx-infra/cache action to d6bd70b (#14646 by @stormslowly)
  • chore(ci): run binary size limit on linux mini runner (#14648 by @stormslowly)
  • chore(ci): compare binary size against PR merge base (#14656 by @stormslowly)
  • test: isolate emit-isolated-dts case to fix cross-suite dts write race (#14659 by @stormslowly)
  • chore(deps): update github-actions (major) (#14639 by @renovate[bot])
  • chore(deps): update dependency @rslint/core to v0.6.4 (#14678 by @renovate[bot])
  • chore(deps): update patch npm dependencies (#14679 by @renovate[bot])
  • chore(deps): update dependency prettier to v3.9.4 (#14680 by @renovate[bot])
  • chore(deps): update rust crate tempfile to 3.27.0 (#14685 by @renovate[bot])
  • chore(deps): update rust crate unicase to 2.9.0 (#14686 by @renovate[bot])
  • chore(deps): update rust crate json-escape-simd to 3.1.0 (#14694 by @renovate[bot])
  • chore(deps): update rust crate derive_more to 2.1.1 (#14692 by @renovate[bot])
  • chore(deps): update rust crate clap to 4.6.1 (#14689 by @renovate[bot])
  • chore(deps): update rust crate bytes to 1.12.0 (#14688 by @renovate[bot])
  • chore(deps): update rust crate dashmap to 6.2.1 (#14691 by @renovate[bot])
  • chore(deps): update rust crate criterion to 4.7.0 (#14690 by @renovate[bot])
  • chore(deps): update napi to 3.10.3 (#14681 by @renovate[bot])
  • chore: bump swc_core from 71 to 72 (#14709 by @CPunisher)
  • chore(deps): bump rspack_resolver to 0.9.4 (#14710 by @stormslowly)

Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.1.2...v2.1.3

View originalPermalink

v2.1.2
What's Changed
Highlights 💡
Support import.meta style module variables
New import.meta APIExisting 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__
New Features 🎉
  • feat: support import.meta style module variables (#14539 by @LingyuCoder)
Performance 🚀
  • perf: deduplicate runtime module macro glue (#14620 by @intellild)
  • perf: avoid cloning side effects artifact in module concatenation (#14622 by @hardfist)
Bug Fixes 🐞
  • fix(browser): inject runtime require into browser MF runtime (#14590 by @CPunisher)
  • fix(ci): build wasm in release debug so the wasm binding gets published (#14614 by @stormslowly)
  • fix(rslib): preserve import phase in dynamic import external rendering (#14615 by @elecmonkey)
  • fix: empty references export for cjs and dynamic import tree shaking (#14629 by @ahabhgk)
Document 📖
  • docs: document asset/resource emit generator option (#14602 by @chenjiahan)
  • docs: document json parser parse option (#14606 by @chenjiahan)
  • docs: document more rule use options (#14610 by @chenjiahan)
  • docs: update module variable docs for import.meta (#14618 by @LingyuCoder)
  • docs: enable Rspress anchor checks (#14627 by @chenjiahan)
Other Changes
  • chore(deps): update patch npm dependencies (#14595 by @renovate[bot])
  • chore(deps): update dependency @babel/preset-react to ^7.29.7 (#14597 by @renovate[bot])
  • chore(deps): update dependency @ast-grep/napi to ^0.44.0 (#14596 by @renovate[bot])
  • chore(deps): update dependency @rsbuild/core to v2.1.1 (#14603 by @renovate[bot])
  • chore(deps): update dependency @rspack/dev-server to ^2.1.0 (#14604 by @renovate[bot])
  • chore(deps): update dependency @shikijs/transformers to ^4.3.0 - autoclosed (#14605 by @renovate[bot])
  • chore(deps): update dependency mermaid to ^11.16.0 (#14607 by @renovate[bot])
  • chore(deps): update dependency ts-checker-rspack-plugin to ^1.5.1 (#14608 by @renovate[bot])
  • chore(deps): update dependency @rsbuild/plugin-sass to v2 (#14609 by @renovate[bot])
  • chore: remove obsolete perf agent skills (#14613 by @hardfist)

Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.1.1...v2.1.2

View originalPermalink

v2.1.1
What's Changed
New Features 🎉
Performance 🚀
Bug Fixes 🐞
Other Changes
New Contributors

Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.1.0...v2.1.1

View originalPermalink

v2.1.0
What's Changed
🎉 See Announcing Rspack 2.1 for more details.
New Features 🎉
Performance 🚀
Bug Fixes 🐞
Refactor 🔨
Document 📖
Other Changes
New Contributors

Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.0.8...v2.1.0

View originalPermalink

v2.1.0-beta.0
Highlights 💡
Support React Compiler in builtin:swc-loader

React 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,
            },
          },
        },
      },
    ],
  },
};
Side-effect-free function analysis by default

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 }
What's Changed
New Features 🎉
Performance 🚀
Bug Fixes 🐞
Refactor 🔨
Document 📖
Other Changes
New Contributors

Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.0.8...v2.1.0-beta.0

View originalPermalink