Optimized main.min.js
simeonackermann opened this issue · 6 comments
Currently its size is about 1.1 MB which too much.
Why it's so big?
Find ways too optimize and minimize.
Webpack build message:
WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets:
main.min.js (1.03 MiB)
WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
main (1.03 MiB)
main.min.js
WARNING in webpack performance recommendations:
You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.
For more info visit https://webpack.js.org/guides/code-splitting/
Why is that a problem at all? Did the user need something else besides the main.min.js?
Ok, the 1.1 MB main.min.js included an experimental routing feature with a lot of translated routing transcriptions.
Without its about 700 KiB, what is closer to the size I had in mind.
But I think this could be still optimized. Beside the main.min.js users have to download CSS files, Images and leaflet tiles. Especially for mobile devices it should be as less as possible.
How much is the size of all files in total?
Our JS, CSS and image files are about 1.1 MB. The quite biggest part is the main.js
The leaflet map tiles for the center of leipzig are 300 KB
But I think the current fixed build size (600KB) is OK and we can close this issue.
Another issue might be performance improvements. Eg test if a React component should update.