Merge pull request #15195 from webpack/fix-hash-function-usage

provide hashFunction parameter to DependencyTemplates
This commit is contained in:
Tobias Koppers 2022-01-18 12:50:56 +01:00 committed by GitHub
commit f16e7468a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -1020,7 +1020,9 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
/** @type {Map<DepConstructor, ModuleFactory>} */
this.dependencyFactories = new Map();
/** @type {DependencyTemplates} */
this.dependencyTemplates = new DependencyTemplates();
this.dependencyTemplates = new DependencyTemplates(
this.outputOptions.hashFunction
);
this.childrenCounters = {};
/** @type {Set<number|string>} */
this.usedChunkIds = null;

View File

@ -57,7 +57,7 @@ class DependencyTemplates {
}
clone() {
const newInstance = new DependencyTemplates();
const newInstance = new DependencyTemplates(this._hashFunction);
newInstance._map = new Map(this._map);
newInstance._hash = this._hash;
return newInstance;