github / webpack-bundlesize-compare-action

A github action that outputs bundlesize comparison tables for pull requests
MIT License
78 stars 19 forks source link

Ignore hash in processed filename #299

Closed t1mwillis closed 1 year ago

t1mwillis commented 1 year ago

Consider the attached screenshot from the action, where app-[hash].js has been removed but a new app-[hash].js has been added. In reality, these are actually the same file for comparison but have a slightly different hash for cache-busting purposes.

Would it be more true to simply move this down to the Smaller section and render a delta?

Screenshot 2023-01-20 at 1 33 48 PM
mattcosta7 commented 1 year ago

@t1mwillis I'm not aware, offhand, of a built in way to know how the user has configured their compilation in this regard from the stats object. Given that we can't know easily which hash type the user is using, nor where in the file the hash is, it's a bit difficult to make that change on our side here. If there is, happy to accept a PR to change it!

If you build without hashes when running comparisons you'll see what you'd expect!

t1mwillis commented 1 year ago

You're right, it would probably have to be an action-level parameter to render an "example" filename of some sort. commons-[hash].js Maybe I'm fork and see if I can get something working... For now I'll close.