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

Lines changed: 4 additions & 11 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy