Does anyone know why TerserPlugin is taking too lo...
# compose-web
j
Does anyone know why TerserPlugin is taking too long when packaging compose web to production. It's like around 20-25 minute???
c
So I currently went with the solution to turn minification off with the webconfig suggestion in the thread. However, stepping back, I’m curious if experimenting with webpack should even need to be done in the first place here, especially if one doesn’t have anything specific to configure. Put another way, I kinda expect the jsBrowserDistribution task to just work out of the box like the other tasks, and should only require manual intervention, e.g. declaring your own webpack config file, if you are really doing something custom.
o
I'd like that too. In this case we're dealing with TerserPlugin, which is used by webpack, and webpack is used by kjs tooling. I don't think that kjs should disable the minification by default. So it's up to a developer to do that when/if needed. For some reason TerserPlugin plugin got stuck in some projects despite not doing anything custom (maybe all of them have bigger js size in common), so manual configuration was found to workaround the issue.
j
I think material icon extended package was big because there are a lot of icons. So, after i've removed that repo then it's just took 2-4 minutes to build. I've used third party tool to generate svg to compose code.
c
Oh interesting! I forgot I do have the library. That might solve it by what you describe
Though 2-4 min build is still a little long 😅
j
It's taken on the github workflow. Because it's build from scratch when cache is not available
👍 1
c
Yeah removing the usage of the Material Icons Extended library drastically sped up things (I converted all the usages as individual Composable functions aka copy/pasted the Material Icons implementations into my project), and I can now properly minify without waiting very long. It brought my
jsApp.js
file from 8 MB to 2!
When I inspected the
jsApp.js
file before remove the dependency, I saw that the kjs does go through the whole thing, even if you aren't using every symbol. It was roughly adding ~20K lines to the JS file.
j
yeah because there a ton's of icons with compose canvas statements. If you check one single file for a single icon then you would imagine how much for extended module. they need to work on this more or we have to use converter to use necessary icons
1