Rslib
This addon loads the reusable parts of the Rsbuild config from your Rslib configuration file while keeping library-only settings out of the Storybook preview build.
It also lets you develop the mf (Module Federation) format inside Storybook.
See the React component library example for a full reference implementation.
Getting started
Installation
Install @rsbuild/core directly so the version that the addon and your framework package use is pinned in your own lockfile. Use this alongside the framework package from your project's framework guide (e.g. storybook-react-rsbuild).
Setup .storybook/main.ts
Before the selected Rslib config is merged into Storybook, it passes through the same inherited-config boundary documented in Builder Options. Plugins remain inherited; use the Storybook CLI's process.env.STORYBOOK flag to conditionally omit an app-only side-effect plugin. Use modifyLibRsbuildConfig to restore a stripped field explicitly for Storybook, or use Storybook's rsbuildFinal for final configuration. Both hooks run after inherited fields are stripped.
Or configure the addon manually:
Module Federation
Review the Rslib Module Federation documentation to prepare the mf output before loading it in Storybook.