docs icon indicating copy to clipboard operation
docs copied to clipboard

Recipe for analyzing bundle size

Open Lehoczky opened this issue 1 year ago • 6 comments

📚 Subject area/topic

Recipes and Guides

📋 Suggested page

https://docs.astro.build/en/recipes/analyze-bundle-size/

📋 General description or bullet points (if proposing new content)

When using client-side JavaScript libraries, it is important to keep track of how much they will increase the final js bundle size. Knowing this, we can optimize our page performance by potentially removing, or lazy-loading our client-side code. An official guide on how to analyze/visualize our page's js budle would be super helpful to do this.

For reference, some other frameworks have guides on how to do this:

  • https://nextjs.org/docs/pages/building-your-application/optimizing/package-bundling#analyzing-javascript-bundles
  • https://nuxt.com/docs/api/nuxt-config#analyze
  • https://remix.run/docs/en/main/guides/performance#bundle-analysis

🖥️ Reproduction of code samples in StackBlitz

No response

Lehoczky avatar Aug 22 '24 11:08 Lehoczky