4.1.6 • Published 4 years ago

cache-loader-hash v4.1.6

Weekly downloads
21
License
MIT
Repository
github
Last release
4 years ago

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.resolve('@datafe/cache-loader-hash');
webpackChain.module.rules
  .values()
  .filter((rule) => rule.uses.has('cache-loader'))
  .forEach((rule) => {
    rule
      .use('cache-loader')
      .loader(CacheLoaderHash)
      .tap((options) => {
        options.mode = 'hash';
        return options;
      });
  });

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

4.1.6

4 years ago

4.1.5

4 years ago

4.1.4

4 years ago

4.1.3

4 years ago

4.1.2

4 years ago

4.1.1

4 years ago

4.1.0

4 years ago