New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(storybook): Allow stylePreprocessorOptions for React storybooks #9481
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/nrwl/nx-dev/AL37JxVS8JiZuYd3RVBcpySBH8K3 [Deployment for f88b6ed canceled] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution! LGTM 🎉
Hi there @sidmonta ! Thanks for your contribution! I don't see how you could have used If you look into the Storybook codebase, you can see that stylePreprocessorOptions appears only in the Storybook Angular builder options, and this makes sense, since it's just passing down this option to the actual Angular builder. I may be wrong, however, and maybe somehow Storybook parses that and includes it in the React builder as well. |
Hi @mandarini. I can't tell you how it works under the hood, but we use it in our React storybooks (with NX 13.8.3). We specified these options the same way you could do for Angular projects:
Specifying it like this allowed us to share SASS mixins and functions. Do you know an other way to realize this for React projects ? |
Hi @fantoine ! I see, I will look into it. So, you're using this in Nx |
HI @fantoine , any updates on this? I really think that it's strange for |
Hi @mandarini. I reproduced our react/storybook configuration here. In this repository you'll find:
Feel free to clone this repository and try to run storybook with It will work correctly until you remove the |
Hi @mandarini. Did you check the sample repository ? |
Hey, @fantoine , not yet, sorry. Lots of things came up :( :( I will as soon as I can |
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
Current Behavior
Currently
styles
&stylePreprocessorOptions
storybook options are automatically removed for non-Angular storybooks.Expected Behavior
These options used to work correctly with React storybooks.
We should be able to use these options with React projects.
Related Issue(s)
Fixes #
Allow Angular AND React project to use these options in storybooks.