theKashey / storybook-include

Folder based storybook configuration for monorepos
MIT License
10 stars 2 forks source link

Addon not working with SWC compiler (storybook-addon-swc) #2

Open martinstepanek opened 2 years ago

martinstepanek commented 2 years ago

Hi,

First of all thanks for your work! This addon is really useful in monorepo environment.

Unfortunately this addon doesn't work (decorators aren't applied) together with storybook-addon-swc. I am not even sure if this is issue with this addon or swc addon as I don't understand how it works "under the hood".

Are you planning any support for it?

  addons: [
    "@storybook/addon-links",
    "@storybook/addon-essentials",
    "@storybook/addon-a11y",

    "storybook-include",
    "storybook-addon-swc",
  ],
theKashey commented 2 years ago

This is happening due to babel-loader being replaced by swc.

I am solving the similar problem right now, and the general idea is a add extra Babel loader with transpiling part disabled and might be only for storybook files.

hrasekj commented 5 months ago

Hello, any progress on this?

theKashey commented 5 months ago

Still just a babel plugin with everything following.


Just commented at another project facing similar issue - https://github.com/gregberge/loadable-components/issues/995#issuecomment-1907373098

You might apply babel plugin from this package before SWC as you need to apply it ONLY to storybook files, leaving the actual code, 99% of your code, to SWC.

That is something very ease to configure for storybook webpack-builder - just another loader.