Skip to content
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

Addons compilation configuration #6399

Closed
JulienPradet opened this issue Apr 3, 2019 · 1 comment
Closed

Addons compilation configuration #6399

JulienPradet opened this issue Apr 3, 2019 · 1 comment

Comments

@JulienPradet
Copy link

JulienPradet commented Apr 3, 2019

Hi! First of all, thanks for the awesome work you are doing y'all!

Is your feature request related to a problem?
I've stumbled into two issues while creating custom addons for our Storybook:

  • There are several webpack aliases and a custom webpack resolver plugin in our webpack configuration but they are not applied to the custom addons
  • Once my project is used as a npm dependency, JSX transformations are no longer applied to my custom addons. This is because we send source files and want those to be compiled by using custom includes in webpack's rules.

Although I managed to find workarounds, I think that it would be great if these use cases could be supported by Storybook.

Describe the solution you'd like
I didn't actually check how it works in Storybook, but my guess is that the custom webpack configurations applied to the stories are not applied to the addons. However, I'm not familiar at all with Storybook's codebase, so I don't know if that's wanted or if that would make sense.

Describe alternatives you've considered
If it's too risky to directly apply webpack.config.js transforms because it is meant to be used for stories only, it would be great to add a webpack.storybook.config.js or something that would make sense for the UI around stories.

Are you able to assist bring the feature to reality?
Yes. If one could point me to where the addons compilation is handled, I'd be happy to give a hand in fixing this issue. But since I'm not even sure that you'd like to support such use cases, I didn't dive into it just yet. :)

Sorry if it was already mentioned in an existing issue, but I didn't manage to find it :)

👋

@shilman
Copy link
Member

shilman commented Apr 3, 2019

Hi @JulienPradet, this is the issue you're looking for and there's a workaround described there: #4995

@ndelangen is working on a cleaner way of doing things for a future version of Storybook (5.2?) but in the meantime the workaround is fully supported.

Closing this as a dupe, please comment there if you have any problems getting things working 👍

@shilman shilman closed this as completed Apr 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants