UNPKG

710 BJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.default = void 0;
7
8class Cache {
9 // eslint-disable-next-line no-unused-vars
10 constructor(compilation) {
11 this.cache = compilation.getCache('HtmlMinimizerWebpackPlugin');
12 }
13
14 async get(cacheData) {
15 // eslint-disable-next-line no-param-reassign
16 cacheData.eTag = cacheData.eTag || this.cache.getLazyHashedEtag(cacheData.assetSource);
17 return this.cache.getPromise(cacheData.assetName, cacheData.eTag);
18 }
19
20 async store(cacheData) {
21 const {
22 source
23 } = cacheData;
24 return this.cache.storePromise(cacheData.assetName, cacheData.eTag, {
25 source
26 });
27 }
28
29}
30
31exports.default = Cache;
\No newline at end of file