Skip to content

Commit 5d90d19

Browse files
committed
remove cache
1 parent 13b769a commit 5d90d19

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

lib/AliasPlugin.js

+4-11
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,12 @@ module.exports = class AliasPlugin {
3131
*/
3232
apply(resolver) {
3333
const target = resolver.ensureHook(this.target);
34-
const cache = {};
3534
const getAbsolutePathWithSlashEnding = maybeAbsolutePath => {
36-
if (cache[maybeAbsolutePath] === undefined) {
37-
const type = getType(maybeAbsolutePath);
38-
if (type === PathType.AbsolutePosix || type === PathType.AbsoluteWin) {
39-
cache[maybeAbsolutePath] = resolver
40-
.join(maybeAbsolutePath, "_")
41-
.slice(0, -1);
42-
} else {
43-
cache[maybeAbsolutePath] = null;
44-
}
35+
const type = getType(maybeAbsolutePath);
36+
if (type === PathType.AbsolutePosix || type === PathType.AbsoluteWin) {
37+
return resolver.join(maybeAbsolutePath, "_").slice(0, -1);
4538
}
46-
return cache[maybeAbsolutePath];
39+
return null;
4740
};
4841
const isSubPath = (path, maybeSubPath) => {
4942
const absolutePath = getAbsolutePathWithSlashEnding(maybeSubPath);

0 commit comments

Comments
 (0)