GeezerVison is showing github.com — Merge pull request #6827 from Connormiha/optimize-sort-by-identifier · webpack/webpack@f600ccd
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: lib/ContextModule.js +7-1Lines changed: 7 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -43,6 +43,8 @@ class ContextModule extends Module { |
43 | 43 |
|
44 | 44 | if (typeof options.mode !== "string") |
45 | 45 | throw new Error("options.mode is a required option"); |
| 46 | + |
| 47 | + this._identifier = this._createIdentifier(); |
46 | 48 | } |
47 | 49 |
|
48 | 50 | updateCacheModule(module) { |
@@ -69,7 +71,7 @@ class ContextModule extends Module { |
69 | 71 | .join("!"); |
70 | 72 | } |
71 | 73 |
|
72 | | - identifier() { |
| 74 | + _createIdentifier() { |
73 | 75 | let identifier = this.context; |
74 | 76 | if (this.options.resourceQuery) |
75 | 77 | identifier += ` ${this.options.resourceQuery}`; |
@@ -86,6 +88,10 @@ class ContextModule extends Module { |
86 | 88 | return identifier; |
87 | 89 | } |
88 | 90 |
|
| 91 | + identifier() { |
| 92 | + return this._identifier; |
| 93 | + } |
| 94 | + |
89 | 95 | readableIdentifier(requestShortener) { |
90 | 96 | let identifier = requestShortener.shorten(this.context); |
91 | 97 | if (this.options.resourceQuery) |
|
Collapse file
Copy file name to clipboardExpand all lines: lib/MultiModule.js +4-1Lines changed: 4 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -15,10 +15,13 @@ class MultiModule extends Module { |
15 | 15 | // Info from Factory |
16 | 16 | this.dependencies = dependencies; |
17 | 17 | this.name = name; |
| 18 | + this._identifier = `multi ${this.dependencies |
| 19 | + .map(d => d.request) |
| 20 | + .join(" ")}`; |
18 | 21 | } |
19 | 22 |
|
20 | 23 | identifier() { |
21 | | - return `multi ${this.dependencies.map(d => d.request).join(" ")}`; |
| 24 | + return this._identifier; |
22 | 25 | } |
23 | 26 |
|
24 | 27 | readableIdentifier(requestShortener) { |
|