mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-19 23:21:09 +00:00
fix(config): upgrade md4 -> md5 on node > 16 (#19108)
This commit is contained in:
parent
c0f7e3344e
commit
2c6b593a85
@ -519,6 +519,17 @@ export function getNuxtConfig (_options) {
|
|||||||
options.build.indicator = false
|
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
|
// Components Module
|
||||||
if (!options._start && getPKG('@nuxt/components')) {
|
if (!options._start && getPKG('@nuxt/components')) {
|
||||||
options._modules.push('@nuxt/components')
|
options._modules.push('@nuxt/components')
|
||||||
|
Loading…
Reference in New Issue
Block a user