diff --git a/packages/config/src/options.js b/packages/config/src/options.js index fb12f84cbe..16f38e547b 100644 --- a/packages/config/src/options.js +++ b/packages/config/src/options.js @@ -519,6 +519,17 @@ export function getNuxtConfig (_options) { options.build.indicator = false } + // Monkey patch crypto.createHash in dev/build to upgrade hashing fnction + if (parseInt(process.versions.node.slice(0, 2)) > 16) { + options.buildModules.push(function patchMD4 () { + const crypto = require('crypto') + const _createHash = crypto.createHash + crypto.createHash = function (algorithm, options) { + return _createHash(algorithm === 'md4' ? 'md5' : algorithm, options) + } + }) + } + // Components Module if (!options._start && getPKG('@nuxt/components')) { options._modules.push('@nuxt/components')