Commit 6d6d86f9 by Tobias Skarhed Committed by GitHub

Storybook: Add internal stories functionality (#23139)

parent 9272c081
...@@ -10,7 +10,7 @@ Storybook is: ...@@ -10,7 +10,7 @@ Storybook is:
## How to create stories ## How to create stories
Stories for a component should be placed next to the component file. The Storybook file requires the same name as the component file. For example, a story for `SomeComponent.tsx` will have the file name `SomeComponent.story.tsx`. Stories for a component should be placed next to the component file. The Storybook file requires the same name as the component file. For example, a story for `SomeComponent.tsx` will have the file name `SomeComponent.story.tsx`. If a story should be internal, not visible in production, name the file `SomeComponent.story.internal.tsx`.
### Writing stories ### Writing stories
......
const stories = ['../src/**/*.story.{js,jsx,ts,tsx,mdx}'];
if (process.env.NODE_ENV !== 'production') {
stories.push('../src/**/*.story.internal.{js,jsx,ts,tsx,mdx}');
}
module.exports = { module.exports = {
stories: ['../src/**/*.story.{js,jsx,ts,tsx,mdx}'], stories: stories,
addons: [ addons: [
'@storybook/addon-knobs', '@storybook/addon-knobs',
'@storybook/addon-actions', '@storybook/addon-actions',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment