cache-loader-hash
Added the mode option to the cache-loader
options, supporting mtime
(default) and hash
.
Usage
npm install cache-loader-hash --save-dev
const CacheLoaderHash = require;webpackChainmodulerules ;
No Breaking Change
No breaking change when using mtime
mode.
Why
We are doing a CI package acceleration work, which will store node_modules/.cache
on s3
, and then pull it from s3
at a certain time. due to
The cache-loader uses mtime
by default for cache verification, which causes the newly installed node_modules in the new CI process to not match the mtime
of node_modules/.cache
on s3
. The solution to this problem is to use the hash of the file instead of mtime as the cache verification method of the cache-loader.
License
MIT