pixelate-it / pixelbattle-frontend

Main website of the Pixel Battle project
http://pixelbattle.fun/
GNU General Public License v3.0
15 stars 3 forks source link

Splitting modules (Some chunks are larger than 500 kBs after minification) #32

Closed sberprime closed 9 months ago

sberprime commented 9 months ago

This error

(!) Some chunks are larger than 500 kBs after minification. Consider:
- Using dynamic import() to code-split the application
- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/configuration-options/#output-manualchunks
- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.

cannot interfere with the site, but mobile players die from long compilation, together with @mirdukkkkk we conducted a small investigation

Why does this happen?

If we divide the frontend into modules (libraries), we will get the following result after minification: idea64

WE FOUND THE IMPOSTER! Oh yeah, @pixi lib is what all the fuss is about, suggest what we can do below.

Test results

Lighthouse (Navigation - Mobile)

LIghthouse

LIghthouse (Navigation - Desktop)

LIghthouse

My comments

LIghthouse The Lighthouse itself says that @pixi is stuffed with too much unusual shit, I’m waiting for the developer’s response on this matter

Thx @mirdukkkkk and me.

sberprime commented 9 months ago

Desktop Lighthouse info image Mobile LIghthouse info image

mirdukkkkk commented 9 months ago

currently in dev branch (without division by libraries)

Lighthouse (Navigation - Mobile)

mobile

Lighthouse (Navigation - Desktop)

desktop

2 times faster ⚡

sberprime commented 9 months ago

fine