bspaulding / rollup-plugin-image-files

Like rollup-plugin-image, but writes image files to dest instead of inlining base64.
MIT License
26 stars 14 forks source link

Feature request: configurable output dir #10

Open sibbl opened 4 years ago

sibbl commented 4 years ago

I'd like to put my image files into a subdirectory but this doesn't seem to be possible at the time.

I'd expect to be able to pass options like

imageFiles({
   dir: "./assets"
})

which would then be appended using path.resolve to the path which is currently used/extracted from the rollup config.

Is there anything which would speak against it or would a PR be appreciated?

bspaulding commented 4 years ago

PRs welcome, @sibbl!

dongyuwei commented 2 years ago

My fork https://github.com/dongyuwei/rollup-plugin-images implemented this feature. And to resolve the potential name conflict, all images are copied with MD5 hash as part of the file name.