I've contributed a PR adding functionality similar to [the webpack imagemin plugin's cacheFolder option](https://github.com/Klathmon/imagemin-webpack-plugin#optionscachefolder): https://github.com/vbenjs/vite-plugin-imagemin/pull/43