gebeto / storybook-addon-manual-mocks

Manual Mocks addon for Storybook
https://www.npmjs.com/package/storybook-addon-manual-mocks
MIT License
6 stars 0 forks source link

Compatibility with rsbuild #19

Open abenhamdine opened 1 month ago

abenhamdine commented 1 month ago

Rspack/rsbuild is webpack rewritten in rust by the ByteDance team It's incredibly performant and more and more popular see https://github.com/web-infra-dev/rsbuild

We are migrating from vite to rsbuild and unfortunelately, the only blocker is this plugin. We failed to make it work with storybook-addon-manual-mocks, we run into the following error with the component using a mocked import :

image

appSessionId is a property of the mock declared like this :

image
gebeto commented 1 month ago

How are you integrating rsbuild to your storybook project? Is this done by this instruction? https://github.com/rspack-contrib/storybook-rsbuild

In this case it looks like I just need to add rsbuild support for this plugin as currently only webpack and vite supported. For rsbuild there are used different config method which should be overrided rsbuildFinal to make it work

abenhamdine commented 1 month ago

How are you integrating rsbuild to your storybook project? Is this done by this instruction? rspack-contrib/storybook-rsbuild

Yes, exactly, sorry I forgot to mention it.

In this case it looks like I just need to add rsbuild support for this plugin as currently only webpack and vite supported. For rsbuild there are used different config method which should be overrided rsbuildFinal to make it work

It would be awesome ! ❤️