chore(core): update webpack hash logic (#3308)

This commit is contained in:
Alex Yang
2023-07-19 15:19:27 +08:00
committed by GitHub
parent 8e9535dd27
commit 710b34a13a
3 changed files with 6 additions and 13 deletions
-8
View File
@@ -1,13 +1,5 @@
import { createHash } from 'node:crypto';
import type { BuildFlags } from '@affine/cli/config';
export function hash(content: string): string {
const hash = createHash('sha512');
hash.update(content);
const pkgHash = hash.digest('hex');
return pkgHash.substring(0, 8);
}
export function computeCacheKey(buildFlags: BuildFlags) {
return [
'1',