plugins pluginsplugins

Used to register Rsbuild plugins.

Official Plugins

The following are official plugins that can be used in Rsbuild, and applicable to Rslib.

For React

Plugins available for the React framework:

For Preact

Plugins available for the Preact framework:

Common

The following are common framework-agnostic plugins:

  • Babel Plugin: Provides support for Babel transpilation capabilities.
  • Sass Plugin: Use Sass as the CSS preprocessor.
  • Less Plugin: Use Less as the CSS preprocessor.
  • Stylus Plugin: Use Stylus as the CSS preprocessor.
  • ESLint Plugin: Run ESLint checks during the compilation.
  • Type Check Plugin: Run TypeScript type checker on a separate process.
  • Image Compress Plugin: Compress the image assets.
  • MDX Plugin: Provide support for MDX.
  • Node Polyfill Plugin: Used to inject polyfills of Node core modules in the browser side.
  • Source Build Plugin: This plugin is designed for the monorepo scenario. It supports referencing source code from other subdirectories and performs build and hot update.
  • Check Syntax Plugin: Check the syntax compatibility of output files and determine if there are any advanced syntaxes that could cause compatibility issues.
  • CSS Minimizer Plugin: Used to customize CSS minimizer, switch to cssnano or other tools for CSS compression.
  • Typed CSS Modules Plugin: Generate TypeScript declaration file for CSS Modules.
  • Pug Plugin: Provides support for the Pug template engine.
  • Rem Plugin: Implements the rem adaptive layout for mobile pages.
  • UMD Plugin: Generate outputs in UMD format.
  • YAML Plugin: Import YAML files and convert them into JavaScript objects.
  • TOML Plugin: Import TOML files and convert them into JavaScript objects.
TIP

You can find the source code of all official plugins in web-infra-dev/rsbuild and rspack-contrib.

Community Plugins

You can check out the Rsbuild plugins provided by the community at awesome-rspack - Rsbuild Plugins.

You can also discover more Rsbuild plugins on npm by searching for the keyword rsbuild-plugin.