The document lists all breaking changes from Rsbuild 0.7 to 1.0. You can refer to this document for migration.
See Breaking changes in Rsbuild v1.0.0 for details.
Rsbuild now enables lightningcss-loader by default to transform CSS files, it replaces autoprefixer
to add vendor prefixes and provides better performance.
@rsbuild/plugin-lightningcss
has been deprecated and no longer needed.tools.autoprefixer
config has been removed.Considering that Lightning CSS has some uncovered edge cases, you can still enable autoprefixer via the postcss config file:
Rsbuild v1 set output.polyfill to 'off'
by default, this can reduce the polyfill code and generate smaller bundles by default.
If your application need polyfill, please set output.polyfill
to 'usage'
or 'entry'
:
Rsbuild now uses 2022-11
decorators version by default. This allows Rsbuild to align the default behavior with TypeScript >= 5.0 and esbuild >= 0.21.0.
If you are using the legacy decorators, you can add the following config:
Rsbuild v1 removes the output.targets
option and the target parameters of source.alias
/source.entry
and other configs, and instead configures it through environments
to provide more flexible multi-environment config capabilities.
Compared with the original options, environments
has a wider coverage and can perform differentiated config of more configs in multiple environments. For details, please refer to Multiple-Environment Builds.
Removed output.targets
config, use output.target and environments config 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
can not 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
.
If you need to use ascii
, you can 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
.