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 PageModern.js Builder
Next PageBuild profiling

#Debug mode

Rsbuild provides a debug mode to troubleshoot problems. You can add the DEBUG=rsbuild environment variable when building to enable Rsbuild's debug mode.

# Debug in development mode
DEBUG=rsbuild pnpm dev

# Debug in production mode
DEBUG=rsbuild pnpm build

In debug mode, Rsbuild will output additional log information and write the Rsbuild config and Rspack config to the dist directory, making it convenient for developers to view and debug.

#Log information

In debug mode, you will see some logs in the terminal starting with rsbuild, including internal operations performed by Rsbuild and the current version of Rspack being used.

$ 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
  ...

Additionally, the following logs will be output in the terminal, indicating that Rsbuild has written the internally generated build configurations to disk. You can open these config files to view the corresponding content.

config inspection completed, generated files:

   - Rsbuild config: /Project/demo/dist/.rsbuild/rsbuild.config.mjs
   - Rspack config (web): /Project/demo/dist/.rsbuild/rspack.config.web.mjs

#Rsbuild config file

In debug mode, Rsbuild will automatically generate a dist/.rsbuild/rsbuild.config.mjs file, which contains the final generated Rsbuild config. In this file, you can see the final result of the Rsbuild config you passed in after being processed by the framework and Rsbuild.

The structure of the file is as follows:

rsbuild.config.mjs
export default {
  dev: {
    // some configs...
  },
  source: {
    // some configs...
  },
  // other configs...
};

For a complete introduction to Rsbuild config, please see the Configure Rsbuild chapter.

#Rspack config file

Rsbuild will also automatically generate dist/.rsbuild/rspack.config.web.mjs file, which contains the final generated Rspack config. In this file, you can see what is included in the config that Rsbuild finally passes to Rspack.

The structure of the file is as follows:

rspack.config.web.mjs
export default {
  resolve: {
    // some resolve configs...
  },
  module: {
    // some Rspack loaders...
  },
  plugins: [
    // some Rspack plugins...
  ],
  // other configs...
};

For a complete introduction to Rspack configs, please see Rspack official documentation.