This addon will load a reuseable Rsbuild config from Rslib config file for storybook-builder-rsbuild, which will make Storybook use an coherent configuration with Rslib. It also provides a way to development mf
(Module Federation) format output.
storybook-addon-rslib
is still under development and subject to change at any time.
.storybook/main.ts
or with config
First, you need to set up a Rslib project with mf
format output.
To make Storybook load remote modules from the Module Federation host app, you can follow the steps below:
Install an additional Module Federation Storybook addon, it will work with storybook-addon-rslib
.
storybook-addon-rslib
will auto start devServer to manage mf
assets.@module-federation/storybook-addon
will make Storybook simulates Module Federation host app to load remote modules.Add dev server config for "mf"
format in rslib.config.ts
.
Add Module Federation types and stories into tsconfig.json
.
Adding storybook-addon-rslib
and @module-federation/storybook-addon
to Storybook config.
Load remote module from the configured remote name.
There you go, start Storybook with npx storybook
.