Skip to content

Commit

Permalink
perf(config): avoid recursive md4 patching
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed May 15, 2023
1 parent 98cd356 commit 7fab952
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/config/src/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ export function getNuxtConfig (_options) {
}

// Monkey patch crypto.createHash in dev/build to upgrade hashing fnction
if (parseInt(process.versions.node.slice(0, 2)) > 16) {
if (parseInt(process.versions.node.slice(0, 2)) > 16 && !options.buildModules.some(m => m.name === 'patchMD4')) {
options.buildModules.push(function patchMD4 () {
const crypto = require('crypto')
const _createHash = crypto.createHash
Expand Down

0 comments on commit 7fab952

Please sign in to comment.