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

Exclude/Include based on output rather than source modules

Open rschristian opened this issue 3 years ago • 1 comments

I'm guessing that this is a bug based on how unintuitive (to me) it feels, but this could very well just be a lack of a feature. Apologies, not sure which box this fits into.

It seems the exclude/include filters act against the source modules, not the output files, which feels like a bug. For example, I can exclude certain source files or node_modules, but I cannot exclude an output file and all of the content that makes it up. This feels like a bug as I'd expect a filter to act upon the current content I'm seeing in the visualizer, not the underlying content that makes up the output.

This also limits the value quite a bit IMO, as you can't easily ignore certain parts of your output. WMR produces a <root>/chunks/prerender.<hash>.js file, for example, and that's entirely server-side. Just content used to prerender. Therefore it can safely be excluded, only, users cannot actually target it with the regex in the UI. They'd have to manually exclude all of the content that the visualizer shows makes up that file.

Stats.html

Not entirely sure one is needed here, but it might be useful so you can see what I'm referring to. https://gist.github.com/rschristian/ccca4aaa3209dc358b6164ad1be7b980

I believe I should be able to write exclusion regex like /^root\/chunks\/prerender.*/ and have it "just work".

rschristian avatar May 27 '21 05:05 rschristian

That would help a lot :) I have a SvelteKit app, and it would be really useful to check precisely what goes in the big chunks by output file name instead of source.

jimzer avatar Jun 23 '22 09:06 jimzer

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

btd avatar Dec 30 '22 11:12 btd