malchata / rollup-plugin-imagemin

Imagemin meets Rollup!
25 stars 7 forks source link

Prevent output of .js files when using images as entry points #4

Open OzymandiasTheGreat opened 5 years ago

OzymandiasTheGreat commented 5 years ago

I'm using a custom plugin to glob most of my source tree as input. Problem is, when specifying non-javascript file as entry point, rollup still generates a bundle for it (often empty, depends on plugins). Anyway even if this plugin didn't emit javascript code, there'd still be empty bundles. So I propose a solution: detect when images are used as entry points and clean up auto generated javascript files at generateBundle event. I got a working solution, if you think this could be useful, I'll make a pull request.

malchata commented 3 years ago

Sorry for the late reply on this. If you still have a PR, I'd be open to it! I've been trying to do some much-needed housekeeping on my repos as of late.

OzymandiasTheGreat commented 3 years ago

I'm sorry, I haven't used rollup in a while and I have pretty much no recollection of the code involved so making a PR at this point is not possible.

malchata commented 3 years ago

No worries. I let this languish for a while anyway, but based on your initial issue, I think I have a way to get this done. Thanks!