Announcing Rsbuild 0.5

March 19, 2024

Rsbuild 0.5 is an important milestone. As of this release, most of the Rsbuild API has reached a stable state and we expect to release Rsbuild 1.0 in Q3 2024.

Main changes:

  • ⚡️ Support for Lightning CSS to speed up CSS compilation.
  • 🌟 Support for custom server based on the new JavaScript API.
  • 🍭 Refactor the SVGR plugin to support more usages.
  • 📍 Support for custom minify options.

⚡️ Supports Lightning CSS

Lightning CSS is a high performance CSS parser, transformer and minifier written in Rust. It supports parsing and transforming many modern CSS features into syntax supported by target browsers, and also provides a better compression ratio.

Rsbuild provides the Lightning CSS plugin to use Lightning CSS on an opt-in basis, replacing the built-in PostCSS, autoprefixer, and SWC CSS minimizer in Rsbuild.

All you need to do is register the Lightning CSS plugin in the Rsbuild configuration to complete the switch:

rsbuild.config.ts
import { pluginLightningcss } from '@rsbuild/plugin-lightningcss';

export default {
  plugins: [pluginLightningcss()],
};

In a real large-scale web application, we have integrated the Rsbuild Lightning CSS plugin and used Rsdoctor to analyze the changes in build time:

  • CSS compilation time was reduced from 8.4s to 0.12s, a 70x improvement.
  • The overall build time was reduced from 33.1s to 25.4s, a 30% increase.

📍 Custom Minify Options

The output.disableMinimize option has been renamed to output.minify, and it allows customizing JS and HTML minification options.

rsbuild.config.ts
export default {
  output: {
    minify: {
      jsOptions: {
        minimizerOptions: {
          mangle: false,
        },
      },
    },
  },
};

Projects using output.disableMinimize can refer to the example below:

export default {
  output: {
-    disableMinimize: true,
+    minify: false,
  },
};

See "allow customize minify options".


For more information, please refer to: