Rstack
This addon loads an app or library definition from your Rstack configuration and reuses its Storybook-safe Rsbuild settings in the preview build.
See the Rstack React app example and the Rstack React component example for complete setups.
Getting started
Installation
Use this alongside the framework package from your project's framework guide, such as storybook-react-rsbuild.
Setup .storybook/main.ts
By default, the addon loads rstack.config.*, prefers define.app() when both app and lib definitions exist, and otherwise falls back to define.lib(). Only the selected definition is executed.
Options
Configure the addon when the defaults do not match your project:
configFilePath: Optionalstring. Absolute path, or relative to the current working directory. Names the Rstack config file, which is loaded through Rstack'sloadRstackConfig().stack: Which definition to inherit. Omit it to preferdefine.app()and fall back todefine.lib().{ type: 'app', environment? }: inheritdefine.app().environmentmust name an existing environment; see the builder's environment option.{ type: 'lib', libIndex? }: inheritdefine.lib().libIndexis anumberorfalse(default0);falseinherits only top-level library config.
Setting stack requires that definition to exist; a missing definition is an error.
If the selected library config omits its lib array, index 0 is an implicit empty entry. An explicit empty array has no valid entry.
Inherited configuration boundary
Inherited configuration follows the same Rsbuild configuration boundary.