I am getting this warning when I build my Frontity app. The warning is for the Frontity project itself, deathstar, not for a specific component.
asset size limit: The following asset(s) exceed the recommended size limit (488 KiB).
This can impact web performance.
Assets:
deathstar.es5.2f6c30b3d61aa7ff1d88.js (835 KiB)
entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (488 KiB). This can impact web performance.
Entrypoints:
deathstar (835 KiB)
deathstar.es5.2f6c30b3d61aa7ff1d88.js
Building module bundle
A good way to reduce the file size is to split the code in separate files.
In the docs there’s a page dedicated on how to do this in your theme or plugin: Code Splitting - Frontity Docs
I do see the different modules in build/static but the final size of the deathstar (The Frontity project itself. Root folder’s package.json) module itself remains the same.
Hi! That warning means only for the js bundle “deathstar.es5.2f6c30b3d61aa7ff1d88.js”, not the whole projects root.
Unfortunately, about the whole project (not only the js bundle) as far as I know, there is not much to do if the code is large and complex. A possible way to solve it would be to take all static files out of the root and save them in WordPress itself or in some CDN.
For example, any image that is uploaded in the assets folder, fonts, json or xml files with data. Of course, this will also result in a higher number of browser requests, so there should be a balance between both options (keep it on the root or move it to a CDN).