Cache Minified Images
RehanSaeed opened this issue · 5 comments
Repeatedly minifying an image should be avoided. A cache containing hashes of minified files should be saved to disk so it can be checked in to Git and shared across a team.
@RehanSaeed The plugin and loader does not compress the images several times, could you elaborate more?
I'm loooking for a Webpack loader than can:
- Minify images.
- I checkin the minified images.
- Another developer runs the loader on their machine.
- Images I previously minified are not minified again because it's a slow and processor intesive process.
When I use Gulp, I can use a caching Gulp task that stores file hashes on disk to achieve the above. See gulp-file-cache for an example, I'm not sure if I can do the same using Webpack.
@RehanSaeed your can use cache-loader
for this purpose https://github.com/webpack-contrib/cache-loader
@RehanSaeed but another developers always run minify images on first run, so works webpack.
cache-loader look sperfect. Thank you!