perf(config): avoid recursive md4 patching

This commit is contained in:
Daniel Roe 2023-05-15 13:23:23 +01:00
parent 98cd356659
commit 7fab952528

View File

@ -520,7 +520,7 @@ export function getNuxtConfig (_options) {
} }
// Monkey patch crypto.createHash in dev/build to upgrade hashing fnction // 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 () { options.buildModules.push(function patchMD4 () {
const crypto = require('crypto') const crypto = require('crypto')
const _createHash = crypto.createHash const _createHash = crypto.createHash