Export Analysis reports wrong sizes
See original GitHub issueDescribe the bug
https://bundlephobia.com/result?p=@timvir/core@0.0.14
The size of the fullWidth
and extendedWidth
should be a few bytes, not 9kB! If you look at the source (https://unpkg.com/browse/@timvir/core@0.0.14/index.js), the extendedWidth
export is essentially this:
function cx(...classNames) {
return classNames.filter(Boolean).join(' ');
}
const noLayout = "n13r7o41";
export const extendedWidth = cx(noLayout, "ev9kr8h");
To Reproduce
Source and output from bundlephobia available in the links above.
Expected behavior
The size of the fullWidth
and extendedWidth
exports should be a few bytes. The whole block above is only ~163 bytes (uncompressed).
Issue Analytics
- State:
- Created 3 years ago
- Reactions:8
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Troubleshoot problems running or exporting a report
Technical issues are usually the reason a report fails to run or export. For example, reports containing very long date ranges may timeout...
Read more >SSRS: Wrong Paper Size Set When Exporting Landscape...
Hi,. I've come across a strange problem with SSRS reports when exporting to Word. I have a report which needs to fit onto...
Read more >How can I get bundlephobia to show different sizes in export ...
So I'm using bundlephobia to audit the bundle size of my packages. Bundlephobia has a section called "Export Analysis" that gives you the ......
Read more >Export to PDF not Exprting to correct Size
Make sure you have the filter pane collapsed when you export the PDF, I had to do that in order to get rid...
Read more >Exporting reports - Oracle Help Center
You can use the reporting API to export data from your reports. From the reporting UI, you can export report data in CSV,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Upon further inspection I think I found a solution to this. Removing the
"browser"
property from my package’spackage.json
, or pointing it to theesm
output makes Bundlephobia report the correct sizes now as seen here. The only thing I find weird about this is thatpackage-build-stats
correctly pointed thepath
to my esm output, even if it wasn’t using that one to calculate the sizes?There’s basically three things required for Bundlephobia to report the correct sizes of each module on its “Export Analysis”:
output.preserveModules = true
).package.json
should point its"browser"
property to your esm bundle, not umd nor cjs.I’m not sure if this is a bug in Bundlephobia, but webpack does tree shake properly regardless of the
"browser"
property (as per my previous comment).I’m having the same issue with some of my packages. This one being a great example since it’s just a bunch of utils. I’m using Rollup to bundle these packages but I have confirmed in a simple project that webpack does tree shake unused imports. This is how I’m testing it:
The resulting bundle does tree-shake everything but
_get
. But, unless I’m understanding incorrectly what Bundlephobia’s export analysis does, it’s implying this would bundle 2.3kb instead of the few bytes that the method itself uses.Note: these are all named exports, exported from a single
index.js
file.