What’s New in Rspack 1.5? Faster Builds, Rust Extensions, and Barrel Optimizations

Rspack 1.5 introduces experimental lazy‑barrel support, a native Rust file‑watcher, browser‑ready builds, Rust‑based plugins, constant and enum inlining, type‑reexport analysis, a built‑in virtual‑module system, module‑federation runtime boosts, install‑size reductions, seal‑stage speedups, and a host of ecosystem updates such as dropping Node 16, stabilizing lazy compilation, and new releases for Rslint, Rsbuild, Rslib, Rspress, Rsdoctor, and Rstest.

ByteDance Web Infra
ByteDance Web Infra
ByteDance Web Infra
What’s New in Rspack 1.5? Faster Builds, Rust Extensions, and Barrel Optimizations

New Features

Barrel File Optimization Rspack now supports the experimental lazyBarrel feature, which detects side‑effect‑free barrel files and defers their re‑exports until they are actually needed, dramatically reducing unnecessary module parsing and build time.

export { Button, Tab } from './components';
export * as utils from './utils';
export * from './hooks';

Enabling lazyBarrel in rspack.config.mjs :

export default {
  experiments: {
    lazyBarrel: true,
  },
};

Benchmarks show a 20%‑49% reduction in build time and module resolution counts for both a small benchmark app and a large ByteDance application.

Faster File System Watcher The previous watchpack watcher had performance bottlenecks. Rspack now ships a native Rust watcher enabled via experiments.nativeWatcher :

export default {
  experiments: {
    nativeWatcher: true,
  },
  watchOptions: {
    // other watch options
  },
};

This native watcher improves HMR speed by up to 50% and reduces CPU/memory usage during development.

Improved Browser Support Rspack 1.4 introduced Wasm target support for WebContainers. With the new @rspack/browser package, you can run Rspack directly in any modern browser without additional containers.

import { rspack, builtinMemFs } from '@rspack/browser';

builtinMemFs.volume.fromJSON({ /* project files */ });

rspack({}, (err, stats) => {
  if (err || stats.hasErrors()) {
    // handle errors
  }
  const files = builtinMemFs.volume.toJSON();
});

The @rspack/browser API mirrors @rspack/core and is currently experimental.

Rspack browser support illustration
Rspack browser support illustration

Rust Extension Support You can now write custom Rust plugins and loaders that replace the default native bindings, eliminating the JavaScript‑Rust interop overhead while keeping full compatibility with the JavaScript API.

Native Performance – Rust plugins run at the same speed as the core Rust engine.

Full Compatibility – No changes required to existing projects.

Developer Convenience – Official templates provide a ready‑to‑use development environment.

Start with the official template and refer to the design rationale for details.

Constant & Enum Inline Optimizations Experimental flags experiments.inlineConst and experiments.inlineEnum enable cross‑module inlining of constants and TypeScript enums, allowing the optimizer to drop dead code branches and shrink bundle size.

// constants.js
export const bold = 0b001;
export const italic = 0b010;

// index.js
import { bold, italic } from './constants';
if (MY_FONT & bold) style['font-weight'] = 'bold';
if (MY_FONT & italic) style['font-style'] = 'italic';

After enabling inlineConst , the above code is reduced to a minimal IIFE that only sets the needed styles.

See the experiments.inlineConst documentation for more details.

Type Re‑Export Analysis The new experiments.typeReexportsPresence flag correctly identifies TypeScript type re‑exports, preventing false warnings about missing value exports.

Refer to the experiments.typeReexportsPresence docs for usage.

Built‑in Virtual Modules Plugin Rspack 1.5 adds a Rust‑implemented VirtualModulesPlugin that replaces the previous webpack-virtual-modules approach, offering better performance for large numbers of virtual modules.

import { rspack } from '@rspack/core';

export default {
  plugins: [
    new rspack.experiments.VirtualModulesPlugin({
      'src/generated/config.js': 'export default { version: "1.0.0" };',
    }),
  ],
};

Module Federation Runtime Boost The runtime code for Module Federation is now merged into the main runtime chunk, reducing bundle size for multi‑entry projects and fixing initialization errors. In a demo, enabling the new plugin shrank the output from 210 KB to 70 KB (‑67%).

Installation Size Optimizations From 63.7 MB in 1.4 to 49.9 MB in 1.5, thanks to compiler flag tweaks, upstream dependency reductions (wasmer, SWC), feature‑flag pruning, and a slimmer browserlist‑rs data structure.

Installation size reduction chart
Installation size reduction chart

Seal Stage Performance Optimizations Large‑scale projects see up to 76% faster seal‑stage processing (e.g., flag dependency exports reduced from 394 ms to 181 ms).

Other Changes

Node.js 16 No Longer Supported

Rspack 1.5 requires Node ≥ 18.12.0 because many ecosystem packages have dropped Node 16 support. Projects still on Node 16 must upgrade.

⚠️ This is a breaking change; upgrade your Node version before using Rspack 1.5.

Resolver JavaScript API

The rspack-resolver library is now integrated into Rspack’s JavaScript API, offering the same capabilities as enhanced-resolve. See the Resolver API documentation for usage.

Stable Lazy Compilation

The previously experimental experiments.lazyCompilation flag is now stable and moved to the top‑level configuration:

// rspack.config.mjs
export default {
  // experiments: { lazyCompilation: true }, // deprecated
  lazyCompilation: true,
};

Deprecated Options

The experiments.topLevelAwait option is deprecated and will be removed in Rspack 2.0.

Rstack Progress

Rslint Release Rslint, a TypeScript‑first linter written in Go, is now publicly released. It supports ESLint‑style configs, VS Code integration, auto‑fix, and over 50 rules.

Rslint announcement
Rslint announcement

Rsbuild 1.5 Rsbuild now enables lazy compilation, lazy barrel, inline enum, and type‑reexport detection by default. It also adds the output.module flag for ES‑module bundles.

export default {
  output: {
    target: 'node',
    module: true,
  },
};

Rslib 0.12 Rslib now bundles the Rstest testing framework and is working on an ESM output pipeline comparable to esbuild and Rollup.

Rslib illustration
Rslib illustration

Rspress 2.0 Beta Rspress 2.0 beta adds a Markdown copy‑to‑clipboard component for LLM integration. The feature is powered by the @rspress/plugin-llms plugin.

Rspress copy component
Rspress copy component

Rsdoctor 1.2 Rsdoctor 1.2 introduces precise aggregation analysis and a new Treemap view for better bundle visualization.

Rstest 0.2 Rstest now offers a full mock API for ES modules, watch‑mode incremental test runs, and keyboard shortcuts for common actions.

Rstest screenshot
Rstest screenshot
RustRspackModule Federationfrontend toolingbuild performanceLazy Compilation
ByteDance Web Infra
Written by

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

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.