1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.default = void 0;
|
7 |
|
8 | class Cache {
|
9 |
|
10 | constructor(compilation) {
|
11 | this.cache = compilation.getCache('HtmlMinimizerWebpackPlugin');
|
12 | }
|
13 |
|
14 | async get(cacheData) {
|
15 |
|
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 |
|
31 | exports.default = Cache; |
\ | No newline at end of file |