December 11, 2023
The Rsbuild 0.2 contains some incompatible API changes. Please refer to the current documentation for upgrading.
We will move the target
option of createRsbuild
to rsbuild config, this change allows user to configure targets
in the rsbuild config file.
const rsbuild = await createRsbuild({
target: ['web', 'node'],
});
// rsbuild.config.ts
export default {
output: {
targets: ['web', 'node'],
},
};
Only affect JavaScript API. Users using the Rsbuild CLI do not need to change.
Remove the deprecated source.entries
config.
source.entries
has been renamed to source.entry
since Rsbuild 0.1.0, and we will remove the legacy source.entries
config in Rsbuild v0.2.0.
// rsbuild.config.ts
export default {
source: {
entries: {},
},
};
// rsbuild.config.ts
export default {
source: {
entry: {},
},
};
dev.writeToDisk
defaults to false
.
Motivation:
User can enable writeToDisk manually:
export default {
dev: {
writeToDisk: true,
},
};
@rsbuild/plugin-babel
will move all babel-loader options to babelLoaderOptions
:
pluginBabel({
plugins: [],
presets: [],
});
pluginBabel([
babelLoaderOptions: {
plugins: [],
presets: [],
}
]);
This change allows us to add more options for pluginBabel
, such as include
and exclude
.
output.disableSourceMap
has been renamed to output.sourceMap
.
export default {
output: {
disableSourceMap: {
js: true,
css: true,
},
},
};
export default {
output: {
sourceMap: {
js: false,
css: false,
},
},
};
The default value of source map has also been updated to improve build performance.
Rename output.disableCssExtract
to output.injectStyles
to be clearer:
export default {
output: {
disableCssExtract: true,
},
};
export default {
output: {
injectStyles: true,
},
};