doesdev / rollup-plugin-analyzer

Mad metrics for your rollup bundles, know all the things

Home Page:http://rollup-plugin-analyzer.doesdev.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Should bundle size in the summary respect the `filter` option?

svoynow opened this issue · comments

It seems like files for which your filter function returns false are still included in the bundle size summary.
I'm not sure if this is intentional. It seems like you could make an argument for it either way.

Good question. I've personally always used it to filter out noise in the detailed output, so for my intent I want to see the overall bundle size info including things I've filtered. However, that might not be the way others use / want to use the filter option.

My first thought is the docs need improved to clarify that, as what I intended may not be what others would assume. I'll do that now.

Next I would say, I wouldn't want to lose the current behavior as I use it that way myself (filter: (m) => m.percent > 2) but still want to see the overall numbers. That said, it could certainly be added as an option if it seems like a worthwhile addition.

I believe all options should affect the summary as well. I would add an other option for your use case globalSummary?

Rather than changing the way it's currently being used (by myself and others) I added an option to apply the filter to the summary information as well. That is in 3.3.0, filterSummary.

Great solution, I will try it out today.