You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I spent a long time today trying to make a situation work that it a very common requirement. I spent so long on this because there is no documentation. A very simple 2-3 line description would save many other people from hours of frustration around this issue.
The issue is that if you are building a package that you intend to publish to npm, then you don't want Babel to process Storybook stories and place them in the ./dist folder. I did this by creating a babel.config.json file in the root of my project with instruction to ignore stories, and another babel.config.json file in the .storybook folder that did not ignore stories.
I thought this would work because the Storybook docs say that Storybook runs its build from inside the .storybook folder, but this approach does not in fact work.
After much reading and experimenting I discovered that renaming my Babel config files to .babelrc fixes the problem. This should be included in the docs that talk about configuring Babel for Storybook.
@Bikeman868 closing this now as with the release of 6.4 we've updated how Babel works with Storybook and how to set it up. Let us know of any issues/improvements on both the documentation and implementation you might want to see added.
I spent a long time today trying to make a situation work that it a very common requirement. I spent so long on this because there is no documentation. A very simple 2-3 line description would save many other people from hours of frustration around this issue.
The issue is that if you are building a package that you intend to publish to npm, then you don't want Babel to process Storybook stories and place them in the
./dist
folder. I did this by creating ababel.config.json
file in the root of my project with instruction to ignore stories, and anotherbabel.config.json
file in the.storybook
folder that did not ignore stories.I thought this would work because the Storybook docs say that Storybook runs its build from inside the
.storybook
folder, but this approach does not in fact work.After much reading and experimenting I discovered that renaming my Babel config files to
.babelrc
fixes the problem. This should be included in the docs that talk about configuring Babel for Storybook.If you want to try this out, my code is here: https://github.com/Bikeman868/react-svg-pie
The text was updated successfully, but these errors were encountered: