Skip to content

[Nuxt.js] Inaccurate bundle size, no vendors.app chunk reported #17

@sgarner

Description

@sgarner

Packtracker looks like a great tool but I'm having trouble getting it to do what I expected. 😞

I am using Packtracker with a Nuxt.js app. I'm loading the webpack plugin in my nuxt.config.ts like this:

import PacktrackerPlugin from '@packtracker/webpack-plugin';

const config: Configuration = {
  // ...
  build: {
    plugins: [new PacktrackerPlugin()],
  }
}

This works and my asset sizes are reported to Packtracker. But the information is not as useful as I would like, because it's not reporting or measuring my "real" bundle size. The reported assets look like this, and correspond to my top level pages in Nuxt:

image

The application size reported by Packtracker back to GitHub is the total of these asset files (162KB):

image

This is fine but it's only a fraction of the picture. If I switch to the "Bundle Explorer" view we can already see that the actual size of my app is significantly larger - 353KB:

image

Question 1 - can Packtracker report the full JS bundle size instead of just the asset files?

Next, notice that this is a "universal" SSR app and the Bundle Explorer view is including the server assets which aren't part of the bundle delivered to clients.

Question 2 - How can we tell the PacktrackerWebpackPlugin not to include server files?

Finally and most importantly, I know the largest contributor to my actual bundle size comes from imported node_modules and these are totally missing from Packtracker's analysis. If somebody imports a new module into the project and blows out the bundle size, I want Packtracker to tell me about it. 💥

Question 3 - Where's the vendors chunk?

If I run nuxt-ts build --analyze, Nuxt's own bundle analyzer, a much more accurate view is produced. It looks like this:

image

As you can see, I've blown out my bundle by importing 6MB of FontAwesome icons. But Packtracker couldn't identify this at all.

How can we get Packtracker's reporting and Nuxt.js's analysis to match up? Is this a configuration issue?

Thanks ❤️

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions