-
SummaryIs there a build-in tag such as I would like to use Storybook as the primary development platform so I want to create stories for internal components and functions. But I want to exclude them from the public Storybook. Additional informationNo response Create a reproductionNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
There is not, however a viable workaround is to depend on environment variables that control which stories are matched in the glob pattern configured in the main configuration. We've used that a couple of places in the past, but you can see one place where we do this today:
Essentially, in your export default {
stories: [
process.env.BUILD_ONLY === 'true' ? '../src/**/!(*.dev-only).stories.ts' : '../src/**/*.stories.ts'
]
} You're free to do whatever logic you want, the above would filter out any files called You could potentially just use |
Beta Was this translation helpful? Give feedback.
There is not, however a viable workaround is to depend on environment variables that control which stories are matched in the glob pattern configured in the main configuration. We've used that a couple of places in the past, but you can see one place where we do this today:
stories
glob conditional on an env var: https://github.com/storybookjs/addon-svelte-csf/blob/b5c9e39a2079b83bad002d65503e9c70c0d0fc70/.storybook/main.ts#L3-L17Essentially, in your
main.ts
you conditionally apply story globs based on some env var: