Excluding a story from build
See original GitHub issueIs your feature request related to a problem? Please describe.
I would like to exclude a story from the build without removing the MyComponent.story.jsx
file or changing storybook configs.
This is for a scenario where I would like to keep a check in a WIP story but prevent it from being surfaced to other engineers while our team works on it.
Describe the solution you’d like
Maybe a .hide()
feature that can be used like this:
storiesOf('MyComponent', module)
.add('without props', () => (<MyComponent />))
.hide() // exclude from build
or testing framework style of:
storiesOf('MyComponent', module)
.xadd('without props', () => (<MyComponent />))
Describe alternatives you’ve considered I can probably exclude the story filename in the config, but it is not obvious and it would be ideal as the status of a story is not obvious from just looking at the story source code only.
Also happy to hear other workarounds that people have used. I considered changing the file extension to something else like MyComponent.stories.pending.jsx
so it doesn’t get picked up by Storybook but this seems like an arbitrary way to do it.
Are you able to assist bring the feature to reality? yes
Additional context I am still on Storybook 3.4.11.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:17
- Comments:10 (5 by maintainers)
Top GitHub Comments
I like
xadd
😃Please upvote the issue if you think it’s useful.