rollup-plugin-visualizer icon indicating copy to clipboard operation
rollup-plugin-visualizer copied to clipboard

Measure percentages against only the included files, not all files

Open rschristian opened this issue 3 years ago • 4 comments

I know exclude and include are still quite new, so you may have this planned, but it would be nice for the stats to measure up against purely the included files, not any excluded.

For example, if I end up excluding something that's 20% of the bundle, it would be nice if the remaining values added up to 100%, as that 20% is no longer being counted.

Thanks for all your work!

rschristian avatar May 10 '21 08:05 rschristian

Hi, it makes sense. Need to think only if it should be default or it should be an option. Not yet sure.

btd avatar May 10 '21 16:05 btd

@btd I think it's should be default include all entries files. In my case, we use Vite to bundle web, and the dist folder has multiple vendor files(include support legacy like ie11). When I include this plugin to analyze, it includes all. So hope you can implement this feature! Thanks

harrytran998 avatar Jul 09 '21 02:07 harrytran998

@harrytran998 I think what you're describing is more like #105. What I was talking about here is updating the percentages based on the modules included.

rschristian avatar Jul 09 '21 03:07 rschristian

@harrytran998 this plugin works with output chunks not with files. Meaning in this context your feature request is irrelevant. Also you always can filter out chunks

btd avatar Jul 09 '21 11:07 btd

I added to plugin and generated files option to include/exclude bundles, files in all bundles or files in specific bundles. When it is done in plugin it is not included in generated file at all. When file not included it is not appeared in generated file and thus its size is not added. I also decided to do not change size if frontend filtering applied. I tried to use it when developing and it confused me at least twice when i forgot this is implemented.

btd avatar Dec 30 '22 11:12 btd

Fair enough, makes sense. Thanks for the consideration anyways!

rschristian avatar Dec 30 '22 11:12 rschristian