Fix build failure due to crypto when using Node 18 or higher

This commit is contained in:
timvisee 2025-02-04 20:07:33 +01:00
parent 906990991e
commit 0c1819bb15
No known key found for this signature in database
GPG key ID: B8DB720BC383E172

View file

@ -6,6 +6,13 @@ const VersionPlugin = require('./build/version_plugin');
const AndroidIndexPlugin = require('./build/android_index_plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
// Fix for node 18+
// See: <https://stackoverflow.com/a/78005686/1000145>
const crypto = require('crypto');
const crypto_orig_createHash = crypto.createHash;
crypto.createHash = algorithm =>
crypto_orig_createHash(algorithm == 'md4' ? 'sha256' : algorithm);
const webJsOptions = {
babelrc: false,
presets: [