webpack-contrib / cache-loader

[DEPRECATED] Caches the result of following loaders on disk
MIT License
638 stars 51 forks source link

add `cacheAddedFiles` option #109

Open mochiya98 opened 4 years ago

mochiya98 commented 4 years ago

This PR contains a:

Motivation / Use-Case

Add option to allow cache the added files. This fixes #99. It also includes small improvements.

Breaking Changes

None.

Additional Info

Old cache files will be unavailable.

codecov[bot] commented 4 years ago

Codecov Report

Merging #109 into master will increase coverage by 2.33%. The diff coverage is 95.23%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #109      +/-   ##
==========================================
+ Coverage   83.09%   85.43%   +2.33%     
==========================================
  Files           2        2              
  Lines         142      151       +9     
  Branches       21       21              
==========================================
+ Hits          118      129      +11     
+ Misses         24       22       -2     
Impacted Files Coverage Δ
src/index.js 85.33% <95.23%> (+2.35%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 4e0e3ae...1ee5ae7. Read the comment docs.

bravomartin commented 4 years ago

This is great. It solves my use case, which is to combine it with responsive-loader. It takes a very long time since it generates multiple versions of each image. I was bummed when I realized it wouldn't emit the files on the second run.

mochiya98 commented 4 years ago

Commitlint has been updated. and I've fixed npm audit issue. Now ready to merge! @evilebottnawi Could you review the PR please?

bravomartin commented 4 years ago

I'm eagerly awaiting for this PR to be merged.

It will make this plugin so much more useful since it will allow using it for caching assets when responsive-loader and other slow loaders.

runemadsen commented 4 years ago

We are waiting for this PR too! It is a bit odd that cache-loader does not cache images, and it took us a while to debug.