Nuxt Tip: Analyse Production Bundle
Michael Hoffmann
@mokkapps
nuxi analyse is an experimental feature that builds your Nuxt application and analyses the production bundle.
To get started, simply call the following command in your project's directory:
npx nuxi analyze
This command creates a local server to view your production bundles:
You can select if you want to view bundle stats for the client or the Nitro server.
The following pictures show the client and server bundle stats for weekly-vue.news:
At first glance, everything could seem overwhelming, but the larger the rectangle, the bigger the dependency is within the bundle and the more likely it is to have an impact on performance.
If you liked this Vue tip, follow me on BlueSky to get notified about new tips, blog posts, and more. Alternatively (or additionally), you can subscribe to my weekly Vue & Nuxt newsletter :
Vue Tip: Destructure Props in Composition API Without Losing Reactivity
Pinia Tip: Use Setup Stores for More Flexibility