What’s New

rspack

Developer Tools

rspack release notes.

Latest v2.1.7 · by rspackWebsiteweb-infra-dev/rspack

Changelog

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

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

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

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

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

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

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

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

v2.1.0-rc.0

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

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

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

v1.7.12

What's Changed
Bug Fixes 🐞
Document Updates 📖
Other Changes

Full Changelog: https://github.com/web-infra-dev/rspack/compare/v1.7.11...v1.7.12