Open sohamnandi77 opened 2 years ago
@tmeasday @ndelangen @shilman Please look into it.
@shilman Please look into it, and let me know if you need anything from my side
@sohamnandi77 do you have a reproduction repo you can share?
Hi @shilman, Sorry for the late reply Here is a reproduction repo: https://github.com/sohamnandi77/storybook-issue (it's a small example, but issue still remains in this repo)
So, if you will inspect through "App-stories.cc25eb1d.iframe.bundle.js" file in storybook-static
you will find that all I have the code for all the files in src/images
folder. like I only imported a single svg in app, but i am seeing all pngs in the bundle. It grows exponentially when there are more components and thus increase the bundle size.
cc: @tmeasday @ndelangen
Looks like the repro is for 6.5.
I'd be interested in the results with the 7.0 beta.
Whenever I use named imports, Storybook includes everything in the index file into the build, which eventually increases the bundle size.
main.js
My package.json
My Folder structure looks like
All the main file in svgs folder, looks like this Ex: images/svgs/noGoals/NoGoals.js
and then I am exporting the Component in the index file
in index file
and in the end, I am export all the files like this in the images/svgs/index.js file
in images/svgs/index.js file
Also, in images/index.js
I have made a .mdx file and I am importing all one of the images using a named import like this
After using this, at the build-storybook step, the storybook is including all the images & their content into the build, which increase the build size
You can notice here that all the bundles generated have the same size. ~3.02MB. it's like all my code is present in all my bundles.