Skip to content

Commit 8ff1c67

Browse files
committed
perf(dev): use node createHash for hashing build manifest
1 parent 528d7a7 commit 8ff1c67

3 files changed

Lines changed: 5 additions & 6 deletions

File tree

packages/nuxt-cli/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@
7171
"get-port-please": "^3.2.0",
7272
"nypm": "^0.6.9",
7373
"obug": "^2.1.4",
74-
"ohash": "^2.0.11",
7574
"pathe": "^2.0.3",
7675
"perfect-debounce": "^2.1.0",
7776
"pkg-types": "^2.3.1",

packages/nuxt-cli/src/utils/nuxt.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import type { Nuxt } from '@nuxt/schema'
22

3+
import { createHash } from 'node:crypto'
34
import { promises as fsp } from 'node:fs'
45

5-
import { hash } from 'ohash'
66
import { dirname, resolve } from 'pathe'
77

88
import { debug, logger } from '../utils/logger'
@@ -64,7 +64,10 @@ export function resolveNuxtManifest(nuxt: Nuxt): NuxtProjectManifest {
6464
nuxt: nuxt._version,
6565
},
6666
}
67-
manifest._hash = hash(manifest)
67+
manifest._hash = createHash('sha256')
68+
.update(JSON.stringify([manifest.project.rootDir, manifest.versions.nuxt]))
69+
.digest('base64url')
70+
.slice(0, 10)
6871
return manifest
6972
}
7073

pnpm-lock.yaml

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)