Gatsby addon for Storybook #28304
Unanswered
shilman
asked this question in
Ideas / Feature Requests
Replies: 2 comments
-
Dropping this comment here with what's working as of today: #26099 (comment) |
Beta Was this translation helpful? Give feedback.
0 replies
-
Note: This addon requires Storybook to be configured for Webpack 5. See the official Storybook with Webpack 5 guide for instructions. Installnpm install -D storybook-addon-gatsby Then include the addon to your Storybook config at // .storybook/main.js
module.exports = {
addons: ["storybook-addon-gatsby"],
}; |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Let's make a Gatsby addon for storybook which configures Storybook to work with Gatsby out of the box. On Storybook's side we can modify our CLI to detect that the user is in a gatsby project and install the addon on
sb init
.Storybook addons can provide
presets
: collections of webpack, babel, and storybook configurations (e.g. for zero-config CRA support). Thre is presets documentation and the documentation for how to write an addon is being rapidly improved by @winkerVSbecks. In this case, the addon would consist entirely of a preset and no UI code.Translating https://www.gatsbyjs.com/docs/visual-testing-with-storybook/ into a preset:
webpackFinal
could be provided by the preset directly.storybook/preview.js
could be provided by a preview entrybabel-preset-react-app
can be provided by ababelDefault
entry in the preset, if needed.cc @wardpeet @KyleAMathews
Beta Was this translation helpful? Give feedback.
All reactions