robertknight / webpack-bundle-size-analyzer

A tool for finding out what contributes to the size of Webpack bundles

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Single <self> line as output

jameswilddev opened this issue · comments

Hello! I've stumbled upon your tool, looks neat! Unfortunately, I'm not getting a breakdown of how much
space each module in my bundle takes up; I get a single line:

<self>: 11.97 KB (100%)

I've checked the JSON file it produces and it looks like the information on the size of each module is in there, so at least I can find the worst offenders and address them.

Something which has occurred to me is that this tool might work at a NPM package rather than node module level; is this the case?

Thanks!

I've just published v2.0.2 which fixes an issue (see #15 ) where the sizes of certain packages were not reported. Please let me know if the issue persists. If it does, the contents of your JSON file would be very useful, or a simplified version that shows the same problem.

Hey!

I'm still seeing only a single line after updating. I might not have done it correctly. I've ran "npm install -g webpack-bundle-size-analyzer", seen 2.0.2 and then ran "json.txt < webpack-bundle-size-analyzer" (maybe Windows-specific syntax). I've attached my Webpack JSON output.

Thanks for looking into this!
json.txt

Hello James,

I see the issue. The tool only reports dependency sizes at the package level, not individual modules within a package. It was designed to help find out which 3rd party packages were bloating bundles. If you wanted to add a more detailed reporting mode that shows modules within a package, I'd be happy to look at a PR.

Ah, that's what I thought. Thanks for the help!