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

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

Open OzymandiasTheGreat opened this issue 5 years ago • 3 comments

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.

OzymandiasTheGreat avatar Jun 28 '19 01:06 OzymandiasTheGreat

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.

malchata avatar Mar 02 '21 20:03 malchata

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.

OzymandiasTheGreat avatar Mar 03 '21 08:03 OzymandiasTheGreat

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!

malchata avatar Mar 03 '21 14:03 malchata