diff --git a/components/webpack/webpack.config.js b/components/webpack/webpack.config.js index a5c88d32aab5..12de923b9381 100644 --- a/components/webpack/webpack.config.js +++ b/components/webpack/webpack.config.js @@ -11,6 +11,14 @@ const pathMap = require('./path-map') const tsConfigPath = path.join(process.env.ROOT_GEN_DIR, 'tsconfig-webpack.json') +// OpenSSL 3 no longer supports the insecure md4 hash, but webpack < 6 +// hardcodes it. Work around by substituting a supported algorithm. +// https://github.com/webpack/webpack/issues/13572 +// https://github.com/webpack/webpack/issues/14532 +const crypto = require("crypto"); +const crypto_orig_createHash = crypto.createHash; +crypto.createHash = algorithm => crypto_orig_createHash(algorithm == "md4" ? "sha256" : algorithm); + module.exports = async function (env, argv) { const isDevMode = argv.mode === 'development' // Webpack config object