From f5f0f4f2a3be76f072dca62acc0428ceef0599a7 Mon Sep 17 00:00:00 2001 From: Jasper Date: Thu, 7 Oct 2021 12:42:27 +0700 Subject: [PATCH] Use SHA-256 as the webpack hash function Webpack defaults to MD4 as the output hash function. MD4 was moved to the legacy provider in OpenSSL 3.0 and is not available by default. As a result, webpack fails to run on any system with OpenSSL 3.0 or later. This patch sets the hash function explicitly to SHA-256 which fixes the webpack build on such systems. SHA-256 is chosen as a reasonable modern default. An alternative solution would be to upgrade to webpack v5.54.0 or later and use webpack's future default hash function xxhash64, which doesn't depend on OpenSSL and is also faster than SHA-256. Related: lib-jitsi-meet#1743 --- resources/load-test/webpack.config.js | 3 ++- webpack.config.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/resources/load-test/webpack.config.js b/resources/load-test/webpack.config.js index be76d955398..73c3ce56c3c 100644 --- a/resources/load-test/webpack.config.js +++ b/resources/load-test/webpack.config.js @@ -94,7 +94,8 @@ const config = { filename: `[name]${minimize ? '.min' : ''}.js`, path: `${__dirname}/libs`, publicPath: 'load-test/libs/', - sourceMapFilename: `[name].${minimize ? 'min' : 'js'}.map` + sourceMapFilename: `[name].${minimize ? 'min' : 'js'}.map`, + hashFunction: 'sha256' }, plugins: [ analyzeBundle diff --git a/webpack.config.js b/webpack.config.js index eca92f12bf5..b854d3c8a48 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -203,7 +203,8 @@ function getConfig(options = {}) { filename: `[name]${minimize ? '.min' : ''}.js`, path: `${__dirname}/build`, publicPath: '/libs/', - sourceMapFilename: `[name].${minimize ? 'min' : 'js'}.map` + sourceMapFilename: `[name].${minimize ? 'min' : 'js'}.map`, + hashFunction: 'sha256' }, plugins: [ detectCircularDeps