QwikDev / qwik

Instant-loading web apps, without effort
https://qwik.dev
MIT License
20.82k stars 1.3k forks source link

[šŸ“–] How to debug Big js chunks on build #6836

Open czuma opened 2 months ago

czuma commented 2 months ago

Suggestion

Create https://qwik.dev/docs/guides/debugging section to add information about how to debug and identify sub-optimal situations.

I was facing this warning about a big js chunk when i preview my site, and don't have idea of what library or where is that. So on big projects will be very difficult to identify what is causing the big chunk of data. big chunk i receive some help on discord community but end with a better solution, a vite pluggin called rollup-plugin-visualizer the process is more or less easy.

After the first run will create the file stats.html on the root project and you can get an interactive graphic with the name of the chunks and the content of it, is size and so on. rolluppluginoutput

on my personal case as you can see the big chunk is a lib called "faker" that i was using on dev to generate test data.

After the identification i can get rid of them on my IDE search tool.

@maiieul ask me to create this issue so we don't forget to add this info on the docs

this week i will create a PR with all the steps

czuma commented 2 months ago

im already create the PR what now?

czuma commented 1 month ago

@wmertens found a better way to do it with npx vite-bundle-visualizer need changes to PR #6857