Improve performance for larger storybooks
See original GitHub issueFirst off, thanks for such a fantastic tool! Our company loves storybook and uses it in hundreds of projects.
Is your feature request related to a problem? Please describe.
Building a storybook with many stories currently leads to webpack performance warnings:
“asset size limit: The following asset(s) exceed the recommended size limit (244 KiB)”
Describe the solution you’d like
It would be great if storybook could implement the code splitting recommendations from the webpack team as shown in the error message attached below; under the hood, so all storybook users with default setups could upgrade and benefit from the performance improvements for “free” without extra config.
Describe alternatives you’ve considered
We have considered extending the default webpack config or using “full control” mode, but would prefer not to “eject” from the default storybook setup. We have also considered breaking up our component library but all the components work together well and it doesn’t make sense to break them up from a consuming developer experience.
Are you able to assist bring the feature to reality?
I love contributing to open source! But probably don’t have time for this currently unless someone can provide a simple implementation.
Additional context
Using default setup (we are not extending or using “full control” of the default webpack setup) of @storybook/react": "^5.0.3"
.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:15
- Comments:14 (6 by maintainers)
Top GitHub Comments
Thanks @shilman, we’re already appending to the Storybook webpack.config so its pretty straightforward to resolve using webpack-merge. The relevant parts of our webpack.config.js look like this:
This can produce quite a few bundles on larger projects. If the concern is improve build speed there are a few splitChunk settings you can play with.
@trevordmiller I think this is happening for most storybook users. Nobody is working on it right now, but I don’t want performance issues to go stale and get swept under the rug so I “reactivated” it. If anybody wants to give it a go, they are welcome to. Hope at some point we can do a perf-oriented release and tackle this and a bunch of other related issues…