Repository navigation
|
Hi, I want to use Storybook in a monorepo, is there a recommended way of using it in a monorepo ? |
Replies: 4 comments 3 replies
|
you can install it in each of the packages you want a storybook for, and then use Composition to combine those storybooks into one. you could also install it at the root of the monorepo and use the |
|
I am currently setting up a monorepo with Lerna containing multiple storybooks. The repo is private though, but I may be able to setup a public example soon. But have some thoughts/insights:
|
|
Another way to setup storybooks that I highly recommend it in a monorepo is using Nrwl Nx. |
|
Just adding my two cents from my experience with storybook in a monorepo in the root vs as-a-package and got to say that a dedicated package for the docs which has the other packages in the monorepo as dependencies made more sense to me as I didn't need to install vast dependencies in the root packages just for the sake of the storybook. Not sure if composition will be the right solution for monorepo as we have access to stories code in the monorepo already so I don't see much value in this. |
you can install it in each of the packages you want a storybook for, and then use Composition to combine those storybooks into one. you could also install it at the root of the monorepo and use the
storiesglob in.storybook/main.jsto suck in all the stories you need.