What’s New

rspack v2.1.0-beta.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

View original