Skip to content

Commit

Permalink
fix: build with node17+
Browse files Browse the repository at this point in the history
  • Loading branch information
zhetengbiji committed Apr 17, 2024
1 parent 8078bef commit cd0f4e5
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions build/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,22 @@ const {
generateApiManifest
} = require('./manifest')

const crypto = require('crypto')

/**
* The MD4 algorithm is not available anymore in Node.js 17+ (because of library SSL 3).
* In that case, silently replace MD4 by the MD5 algorithm.
*/
try {
crypto.createHash('md4')
} catch (e) {
// console.warn('Crypto "MD4" is not supported anymore by this Node.js version');
const origCreateHash = crypto.createHash
crypto.createHash = (alg, opts) => {
return origCreateHash(alg === 'md4' ? 'md5' : alg, opts)
}
}

const fixInnerHTML = require('./fixInnerHTML')

const service = new Service(process.env.VUE_CLI_CONTEXT || process.cwd(), {
Expand Down

0 comments on commit cd0f4e5

Please sign in to comment.