Migrating from Rsbuild 0.x
This document lists all breaking changes from Rsbuild 0.7 to 1.0. Use it as a migration reference.
See Breaking changes in Rsbuild v1.0.0 for details.
[Important] Lightning CSS loader
Rsbuild now enables lightningcss-loader by default to transform CSS files. It replaces autoprefixer for adding vendor prefixes and delivers better performance.
@rsbuild/plugin-lightningcssis deprecated and no longer needed.tools.autoprefixerconfig has been removed.
Since Lightning CSS has some uncovered edge cases, you can still enable autoprefixer through a postcss config file:
[Important] output.polyfill
Rsbuild v1 sets output.polyfill to 'off' by default. This reduces polyfill code and generates smaller bundles.
If your application needs polyfills, set output.polyfill to 'usage' or 'entry':
[Important] source.decorators
Rsbuild now uses 2022-11 decorators version by default. This aligns Rsbuild's default behavior with TypeScript >= 5.0 and esbuild >= 0.21.0.
For legacy decorators, add this config:
[Important] output.targets
Rsbuild v1 removes the output.targets option and target parameters from source.alias, source.entry, and other configs. Instead, use environments for more flexible multi-environment configuration.
The environments option provides broader coverage and enables differentiated config across multiple environments. For details, see Multiple-Environment Builds.
The output.targets config has been removed. Use output.target and environments instead.
- before:
- after:
source.alias
Removed target param for source.alias function, use environments config instead.
- before:
- after:
source.entry
Removed function usage of source.entry, use environments config instead.
- before:
- after:
output.overrideBrowserslist
output.overrideBrowserslist no longer supports Record<RsbuildTarget, string[] type, use environments config instead.
- before:
- after:
output.emitAssets
output.emitAssets changed to boolean type, use environments config instead.
- before:
- after:
output.distPath.server
Removed output.distPath.server, use the environments config instead.
output.minify.html
Rsbuild v1 removed the output.minify.html and output.minify.htmlOptions options, and no longer minify the HTML files.
Previously Rsbuild uses html-minifier-terser to minify the HTML files. But the performance of html-minifier-terser cannot meet the needs of Rsbuild applications, and in most cases, there is little benefit in compressing HTML.
At this stage, Rsbuild will not built-in html-minifier-terser, so we provide a standalone rsbuild-plugin-html-minifier-terser to support HTML minification.
And we plan to use some faster Rust-based HTML minimizer in the future.
output.charset
The default value of output.charset has been changed from ascii to utf8.
To use ascii, add the following config:
dev.startUrl
dev.startUrl has been renamed to server.open:
dev.client.port
The default value of dev.client.port changed from <port> to '' (use location.port).
Use the previous value if you want to keep the behavior:
html.appIcon
Previously, html.appIcon did not support for web app manifests, meaning it was only available on iOS.
Now html.appIcon supports generating web app manifests, and the type of html.appIcon has been changed.
- before:
- after:
Others
Rsbuild 1.0 has made some adjustments and optimizations to plugins API and dev server API.
Includes:
- The
onBeforeBuildhook supports triggering multiple times in watch mode. - Added
onBeforeEnvironmentCompileandonAfterEnvironmentCompilehooks, which are triggered before/after executing the build of a single environment respectively. - Removed
api.getHtmlPathsand replaced it withenvironment.htmlPaths. - Removed
api.context.entryand replaced it withenvironment.entry. - Removed
api.context.targetsand replaced it withenvironment.target. - Removed
rsbuildServer.onHTTPUpgradeand replaced it withrsbuildServer.connectWebSocket.

