Browse Source

fix #9424

remove unused code
tags/v4.36.1
Tobias Koppers 5 months ago
parent
commit
1f966eb9d0
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      lib/ResolverFactory.js

+ 3
- 3
lib/ResolverFactory.js View File

@@ -10,6 +10,8 @@ const { cachedCleverMerge } = require("./util/cleverMerge");

/** @typedef {import("enhanced-resolve").Resolver} Resolver */

const EMTPY_RESOLVE_OPTIONS = {};

module.exports = class ResolverFactory extends Tapable {
constructor() {
super();
@@ -40,13 +42,11 @@ module.exports = class ResolverFactory extends Tapable {
return true;
}
});
this.cache1 = new WeakMap();
this.cache2 = new Map();
}

get(type, resolveOptions) {
const cachedResolver = this.cache1.get(resolveOptions);
if (cachedResolver) return cachedResolver();
resolveOptions = resolveOptions || EMTPY_RESOLVE_OPTIONS;
const ident = `${type}|${JSON.stringify(resolveOptions)}`;
const resolver = this.cache2.get(ident);
if (resolver) return resolver;

Loading…
Cancel
Save