Configure the build outputs.
The charset
config allows you to specify the character encoding for output files to ensure they are displayed correctly in different environments.
Whether to clean up all files under the output directory before the build starts (the output directory defaults to dist
).
Copies the specified file or directory to the dist directory, implemented based on rspack.CopyRspackPlugin.
For custom CSS Modules configuration.
Set the size threshold to inline static assets such as images and fonts.
Set the directory of the dist files. Rsbuild will output files to the corresponding subdirectory according to the file type.
Whether to emit CSS to the output bundles.
At build time, prevent some import
dependencies from being packed into bundles in your code, and instead fetch them externally at runtime.
It is important to note that output.externals
differs from resolve.alias. Check out resolve.alias documentation for more information.
Whether to add a hash value to the filename after the production build.
Sets the filename of dist files.
Whether to inline output scripts files (.js files) into HTML with <script>
tags.
Whether to inline output style files (.css files) into HTML with <style>
tags.
Configure how to handle the legal comment.
Whether to generate a manifest file that contains information of all assets, and the mapping relationship between entry module and assets.
Configure whether to enable code minification in production mode, or to configure minimizer options.
Specifies the range of target browsers that the project is compatible with.
Through the output.polyfill
option, you can control the injection mode of the polyfills.
Rsbuild's output.polyfill
injects polyfills into the global scope, which can unexpectedly modify global variables for library consumers. For a non-global polyfill solution for browsers, please refer to Polyfill - Browser.
Used to set whether to generate source map files, and which format of source map to generate.
Setting the build target of Rsbuild.
Check out the Solution to learn more about the build target.