Skip to content

Commit 8c11da5

Browse files
committed
Save identifier module after first getting
1 parent d668a23 commit 8c11da5

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

‎lib/ContextModule.js‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ class ContextModule extends Module {
4444

4545
if (typeof options.mode !== "string")
4646
throw new Error("options.mode is a required option");
47+
48+
this._identifier = null;
4749
}
4850

4951
prettyRegExp(regexString) {
@@ -65,6 +67,7 @@ class ContextModule extends Module {
6567
}
6668

6769
identifier() {
70+
if (this._identifier) return this._identifier;
6871
let identifier = this.context;
6972
if (this.options.resourceQuery)
7073
identifier += ` ${this.options.resourceQuery}`;
@@ -78,6 +81,8 @@ class ContextModule extends Module {
7881
identifier += " strict namespace object";
7982
else if (this.options.namespaceObject) identifier += " namespace object";
8083

84+
this._identifier = identifier;
85+
8186
return identifier;
8287
}
8388

‎lib/MultiModule.js‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,13 @@ class MultiModule extends Module {
1515
// Info from Factory
1616
this.dependencies = dependencies;
1717
this.name = name;
18+
this._identifier = `multi ${this.dependencies
19+
.map(d => d.request)
20+
.join(" ")}`;
1821
}
1922

2023
identifier() {
21-
return `multi ${this.dependencies.map(d => d.request).join(" ")}`;
24+
return this._identifier;
2225
}
2326

2427
readableIdentifier(requestShortener) {

0 commit comments

Comments
 (0)