webpack-bundle-diff icon indicating copy to clipboard operation
webpack-bundle-diff copied to clipboard

(feat): Allow to add threshold to minor changes from cli

Open nickshevr opened this issue 5 years ago • 3 comments

Module Count Size
+ ./node_modules/lodash/lodash.js 4 +481,460
2 modules with minor changes +51

In this case I want to know which module break lodash threeshaking.

nickshevr avatar Nov 18 '20 08:11 nickshevr

@nickshevr: One way to get more detail is to look at the raw diff.json file — it will show all the details (albeit in a less readable format).

Typically these minor changes are due to little variations due to the way webpack processes the modules. That's why I compress them in the results. If you're looking for a problem with treeshaking, it seems like the problem is in the lodash.js module and those that it depends on. (The "4" in the count column indicates that this module is pulling a total of 4 modules which together account for the added size.) I don't know what the problem would be, but I doubt it has to do with the hidden minor changes.

smikula avatar Nov 18 '20 18:11 smikula

@smikula Hey, maybe it's not good example. But I think if u have an option into JS interface, you should give a possibility to add it from CLI. My example shows, that minor changes can me meaningful.

nickshevr avatar Nov 19 '20 13:11 nickshevr

@nickshevr, sure, that makes sense. I'll merge the PR. (Edit: or I will once I get the build to pass...just moved to Github Actions and still figuring it out.)

smikula avatar Nov 20 '20 02:11 smikula