If you're using Storybook 7.0 for React with Webpack5, it's possible to use Rspack using an experimental builder.
First, we need to add storybook-react-rspack
dependency, and uninstall the @storybook/react-webpack5
dependency.
{
"dependencies": {
- "@storybook/react-webpack5": "^7"
+ "storybook-react-rspack": "latest"
}}
Then, make the corresponding change to the Storybook main.js
config:
export default {
- framework: '@storybook/react-webpack5'
+ framework: 'storybook-react-rspack'
}
There is a example here react-storybook
Support for Storybook 7.0 is still experimental, and there are some limitations:
There is also incomplete docgen support to automatically generate controls from components.
Rspack is currently compatible with the following main.js
configuration, however this has known issues and is a work in progress.
export default {
typescript: {
reactDocgen: 'react-docgen',
},
};