webpack-contrib/image-minimizer-webpack-plugin

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:

  1. Minify images.
  2. I checkin the minified images.
  3. Another developer runs the loader on their machine.
  4. 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 but another developers always run minify images on first run, so works webpack.

cache-loader look sperfect. Thank you!