close
logologo
Guide
Config
Plugin
API
Community
Version
Changelog
Rsbuild 0.x Doc
English
简体中文
Guide
Config
Plugin
API
Community
Changelog
Rsbuild 0.x Doc
English
简体中文
logologo

Getting Started

Introduction
Quick start
Features
Glossary

Framework

React
Vue
Preact
Svelte
Solid

Basic

CLI
Dev server
Output files
Static assets
HTML
JSON
Wasm
TypeScript
Web Workers
Deploy static site
Upgrade Rsbuild

Configuration

Configure Rspack
Configure Rsbuild
Configure SWC

Styling

CSS
CSS Modules
CSS-in-JS
Tailwind CSS v4
Tailwind CSS v3
UnoCSS

Advanced

Path aliases
Environment variables
Hot module replacement
Browserslist
Browser compatibility
Module Federation
Multi-environment builds
Server-side rendering (SSR)
Testing

Optimization

Code splitting
Bundle size optimization
Improve build performance
Inline static assets

Migration

Migrating from Rsbuild 0.x
webpack
Create React App
Vue CLI
Vite
Vite plugin
Modern.js Builder

Debug

Debug mode
Build profiling
Use Rsdoctor

FAQ

General FAQ
Features FAQ
Exceptions FAQ
HMR FAQ
📝 Edit this page on GitHub
Previous PageGeneral FAQ
Next PageExceptions FAQ

#Features FAQ

#How to import UI component library on demand?

To configure the on-demand import of the component library, you can configure it through source.transformImport, which is equivalent to babel-plugin-import.

export default {
  source: {
    transformImport: [
      {
        libraryName: 'my-components',
        libraryDirectory: 'es',
        style: true,
      },
    ],
  },
};

#How to run ESLint during compilation?

For the sake of compilation performance, Rsbuild will not perform ESLint verification during the compilation process by default. If you require this feature, you can use Rsbuild's ESLint plugin.


#How to configure CDN path for static assets?

To upload static assets such as JS and CSS to CDN for use, set the URL prefix of static assets through the output.assetPrefix configuration.

export default {
  output: {
    assetPrefix: 'https://cdn.example.com/assets/',
  },
};

#How to remove console after production build?

For the production build, we can remove the console from the code, so as to avoid the log of the development mode being output to the production.

Rsbuild provides a configuration option to remove console by default, please see performance.removeConsole.


#How to view the final generated Rspack configuration?

By using the Rsbuild debug mode, you can view the Rspack configuration generated by Rsbuild.

You can enable the debug mode of Rsbuild by adding the DEBUG=rsbuild environment variable when performing the build. In this mode, the internally generated Rspack configuration will be outputted to the "dist" directory.

➜ DEBUG=rsbuild pnpm dev

  ...
  rsbuild 10:00:00 configuration loaded from: /path/to/...
  rsbuild 10:00:00 registering default plugins
  rsbuild 10:00:00 default plugins registered
  ...

config inspection completed, generated files:

  - Rsbuild config: /root/my-project/dist/.rsbuild/rsbuild.config.mjs
  - Rspack config (web): /root/my-project/dist/.rsbuild/rspack.config.web.mjs

#How to ignore specific warnings?

By default, Rsbuild will print all error and warning logs generated by the build process.

If a large number of warning logs are generated by a third-party package and you want to ignore them, specific warning logs can be ignored through the ignoreWarnings configuration provided by Rspack.

export default {
  tools: {
    rspack: {
      ignoreWarnings: [/Using \/ for division outside of calc()/],
    },
  },
};

For details, please refer to: ignoreWarnings.