mirror of
https://gitlab.com/timvisee/send.git
synced 2025-12-06 14:10:53 +03:00
Fix build failure due to crypto when using Node 18 or higher
This commit is contained in:
@@ -6,6 +6,13 @@ const VersionPlugin = require('./build/version_plugin');
|
|||||||
const AndroidIndexPlugin = require('./build/android_index_plugin');
|
const AndroidIndexPlugin = require('./build/android_index_plugin');
|
||||||
const ExtractTextPlugin = require('extract-text-webpack-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 = {
|
const webJsOptions = {
|
||||||
babelrc: false,
|
babelrc: false,
|
||||||
presets: [
|
presets: [
|
||||||
|
|||||||
Reference in New Issue
Block a user