Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sgarner opened this issue May 9, 2020 · 0 comments
Open

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

sgarner opened this issue May 9, 2020 · 0 comments

Comments

@sgarner
Copy link

sgarner commented May 9, 2020

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 ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant