mirror of
https://git.unlock-music.dev/um/web.git
synced 2025-05-09 15:53:26 +00:00
build: support node v22
This commit is contained in:
parent
f22b05f40d
commit
b0ee928199
21
patches/babel-loader+8.2.3.patch
Normal file
21
patches/babel-loader+8.2.3.patch
Normal file
@ -0,0 +1,21 @@
|
||||
diff --git a/node_modules/babel-loader/lib/cache.js b/node_modules/babel-loader/lib/cache.js
|
||||
index fced210..6b0c137 100644
|
||||
--- a/node_modules/babel-loader/lib/cache.js
|
||||
+++ b/node_modules/babel-loader/lib/cache.js
|
||||
@@ -91,15 +91,7 @@ const write = /*#__PURE__*/function () {
|
||||
|
||||
|
||||
const filename = function (source, identifier, options) {
|
||||
- // md4 hashing is not supported starting with node v17.0.0
|
||||
- const majorNodeVersion = parseInt(process.versions.node.split(".")[0], 10);
|
||||
- let hashType = "md4";
|
||||
-
|
||||
- if (majorNodeVersion >= 17) {
|
||||
- hashType = "md5";
|
||||
- }
|
||||
-
|
||||
- const hash = crypto.createHash(hashType);
|
||||
+ const hash = crypto.createHash("sha256");
|
||||
const contents = JSON.stringify({
|
||||
source,
|
||||
options,
|
13
patches/copy-webpack-plugin+5.1.2.patch
Normal file
13
patches/copy-webpack-plugin+5.1.2.patch
Normal file
@ -0,0 +1,13 @@
|
||||
diff --git a/node_modules/copy-webpack-plugin/dist/postProcessPattern.js b/node_modules/copy-webpack-plugin/dist/postProcessPattern.js
|
||||
index 8354f00..9bdf6ed 100644
|
||||
--- a/node_modules/copy-webpack-plugin/dist/postProcessPattern.js
|
||||
+++ b/node_modules/copy-webpack-plugin/dist/postProcessPattern.js
|
||||
@@ -69,7 +69,7 @@ function postProcessPattern(globalRef, pattern, file) {
|
||||
name: _package.name,
|
||||
version: _package.version,
|
||||
pattern,
|
||||
- hash: _crypto.default.createHash('md4').update(content).digest('hex')
|
||||
+ hash: _crypto.default.createHash('sha256').update(content).digest('hex')
|
||||
});
|
||||
return _cacache.default.get(globalRef.cacheDir, cacheKey).then(result => {
|
||||
logger.debug(`getting cached transformation for '${file.absoluteFrom}'`);
|
13
patches/terser-webpack-plugin+1.4.5.patch
Normal file
13
patches/terser-webpack-plugin+1.4.5.patch
Normal file
@ -0,0 +1,13 @@
|
||||
diff --git a/node_modules/terser-webpack-plugin/dist/index.js b/node_modules/terser-webpack-plugin/dist/index.js
|
||||
index 6268f6b..1cb8f2c 100644
|
||||
--- a/node_modules/terser-webpack-plugin/dist/index.js
|
||||
+++ b/node_modules/terser-webpack-plugin/dist/index.js
|
||||
@@ -214,7 +214,7 @@ class TerserPlugin {
|
||||
// eslint-disable-next-line global-require
|
||||
'terser-webpack-plugin': require('../package.json').version,
|
||||
'terser-webpack-plugin-options': this.options,
|
||||
- hash: _crypto.default.createHash('md4').update(input).digest('hex')
|
||||
+ hash: _crypto.default.createHash('sha256').update(input).digest('hex')
|
||||
};
|
||||
task.cacheKeys = this.options.cacheKeys(defaultCacheKeys, file);
|
||||
}
|
26
patches/webpack+4.46.0.patch
Normal file
26
patches/webpack+4.46.0.patch
Normal file
@ -0,0 +1,26 @@
|
||||
diff --git a/node_modules/webpack/lib/optimize/SplitChunksPlugin.js b/node_modules/webpack/lib/optimize/SplitChunksPlugin.js
|
||||
index e7d560b..94a8401 100644
|
||||
--- a/node_modules/webpack/lib/optimize/SplitChunksPlugin.js
|
||||
+++ b/node_modules/webpack/lib/optimize/SplitChunksPlugin.js
|
||||
@@ -22,7 +22,7 @@ const deterministicGroupingForModules = /** @type {function(DeterministicGroupin
|
||||
|
||||
const hashFilename = name => {
|
||||
return crypto
|
||||
- .createHash("md4")
|
||||
+ .createHash("sha256")
|
||||
.update(name)
|
||||
.digest("hex")
|
||||
.slice(0, 8);
|
||||
diff --git a/node_modules/webpack/lib/util/createHash.js b/node_modules/webpack/lib/util/createHash.js
|
||||
index 64de510..4cc3fc9 100644
|
||||
--- a/node_modules/webpack/lib/util/createHash.js
|
||||
+++ b/node_modules/webpack/lib/util/createHash.js
|
||||
@@ -131,6 +131,8 @@ module.exports = algorithm => {
|
||||
// TODO add non-cryptographic algorithm here
|
||||
case "debug":
|
||||
return new DebugHash();
|
||||
+ case 'md4':
|
||||
+ algorithm = "sha256";
|
||||
default:
|
||||
return new BulkUpdateDecorator(require("crypto").createHash(algorithm));
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user