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.
Rsbuild now enables lightningcss-loader by default to transform CSS files. It replaces autoprefixer
for adding vendor prefixes and delivers better performance.
@rsbuild/plugin-lightningcss
is deprecated and no longer needed.tools.autoprefixer
config has been removed.Since Lightning CSS has some uncovered edge cases, you can still enable autoprefixer through a postcss config file:
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'
:
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:
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.
Rsbuild now enables Rspack's scheme validation by default to ensure the Rspack configuration is correct.
For more details, see Rspack - RSPACK_CONFIG_VALIDATE.
Removed target
param for source.alias
function, use environments config instead.
Removed function usage of source.entry
, use environments config instead.
output.overrideBrowserslist
no longer supports Record<RsbuildTarget, string[]
type, use environments config instead.
output.emitAssets
changed to boolean type, use environments config instead.
Removed output.distPath.server
, use the environments config instead.
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.
The default value of output.charset has been changed from ascii
to utf8
.
To use ascii
, add the following config:
dev.startUrl
has been renamed to server.open:
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:
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.
Rsbuild 1.0 has made some adjustments and optimizations to plugins API and dev server API.
Includes:
onBeforeBuild
hook supports triggering multiple times in watch mode.onBeforeEnvironmentCompile
and onAfterEnvironmentCompile
hooks, which are triggered before/after executing the build of a single environment respectively.api.getHtmlPaths
and replaced it with environment.htmlPaths
.api.context.entry
and replaced it with environment.entry
.api.context.targets
and replaced it with environment.target
.rsbuildServer.onHTTPUpgrade
and replaced it with rsbuildServer.connectWebSocket
.