Ionic 4 build output why so many files?

I have just built my first Ionic 4 (angular) app.

ionic build --prod

Looking inside my “www” folder there are 885 files… yes I typed that correctly… 885 files!!

having read a couple of threads I understand the need to chunk the JS is a feature designed to increase the load time however why does it generate a separate SVG file for every single IOS, MD and Logo ionicon? Surely the most sensible approach would be to only generate files for the icons that have been used. I can only assume that if this is the approach then when it compiled the 185 JavaScript files it did so for a good number of components that i’m not using either.

Is there a way of creating a build that only the complies the components / icons that i am using?

Thanks

3 Likes

I don’t think there is a way. For the components I think I once read that it’s a feature respectively the design

For the icons, I had the same wish as I don’t want to ship unecessary icon in my app in the apple/android store. I have opened a feature request for that on the GitHub (in the cli I think)

hi, have u found any solution to avoid this numerous generated files? I am deploying an web app to a shared hosting… so it is really very frustrating to every time i made change something to code and deploy this huge numbers of files via filezilla

Like I said above there, right now, I don’t think there is a way. If it would not take too much time to implement , maybe you could automate with scripts or else your deploy to ease your process?

No solution yet?
We’re on XXI Century and for a simple App, this whole things is creating more than 500+ files.

Same problem for me. Distribution of all ionic icons on every app…no sense.
Hope they patch this behaviour soon.

+1 this really needs fixed.

+1 while this can be a feature, there needs to be an option to bundle everything into a lower amout of files.

Did you find a way to fix this?