Skip to content

Commit

Permalink
Fix: fixes cacheKey
Browse files Browse the repository at this point in the history
cacheKey was not referenced right and not implemented in the cache manager.
  • Loading branch information
naranjamecanica committed Nov 22, 2023
1 parent a089e93 commit 02a274e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions packages/core/src/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ function md5(buffer: BinaryLike): string {
}

export function createCacheKey(options: ResolvedConfigOptions) {
if (options.cacheKey) {
return options.cacheKey
}

return md5(
Object.entries(options)
.filter(
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export const parseOptions = (
: true,
cache: isBoolean(_options?.cache) ? _options.cache : true,
cacheDir: isString(_options?.cacheDir) ? _options.cacheDir : undefined,
cacheKey: isString(_options?.cacheDir) ? _options.cacheDir : '',
cacheKey: isString(_options?.cacheKey) ? _options.cacheKey : '',
clearCache: isBoolean(_options?.clearCache) ? _options.clearCache : false,
plugins,
makeAvif,
Expand Down

0 comments on commit 02a274e

Please sign in to comment.