Hey! I am getting this warning when I run `jsBrows...
# compose-web
s
Hey! I am getting this warning when I run
jsBrowserProductionWebpack
Copy code
entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Does anyone know if this is indeed because the size is pretty big or am I missing some configurations
r
Kotlin/JS output bundle size usually exceeds this webpack's recommended limit. The only thing you can do is disable the warning: https://github.com/rjaros/kvision-examples/blob/master/template/webpack.config.d/webpack.js#L11-L16
s
Thanks @Robert Jaros. I see this line in the generated webpack config
config.devtool = 'source-map';
. In the example you shared I see devtool is set to undefined for production. Could this help in reducing the size
r
No, it doesn't affect bundle size.
1
It does something ..., but I don't remember what exactly 😉
s
Ah ok. It says my main js file is 1.99MB which I think is a lot but I when I actually look at the file, its 6KB.
r
2MB is probably the right value. And you can easily have bigger bundles for larger Kotlin/JS apps.
It's good to have gzip compression enabled on the server.
s
Makes sense, thanks a lot for your help ❤️
c
yeah, Kotlin bundles are usually too big to be good for smaller marketing or content-type sites where not much interactivity is needed. The overhead of a huge bundle on a site where users might only view the page once is terrible for SEO. But for larger webapps where you expect the user to keep coming back and using the app, the bundle size isn’t as much of a concern since it’s a one-time penalty. The JS bundle gets cached by the browser for subsequent visits, but even without that it’s not unreasonable for a user to wait a few seconds for any highly interactive webapp to load. You may want to display some basic content to let the user know the app is loading.
👍 1
1
👍🏻 1