MCPcopy
hub / github.com/webpack/webpack / identifier

Method identifier

lib/css/CssModule.js:78–113  ·  view source on GitHub ↗

* Returns the unique identifier used to reference this module. * @returns {string} a unique identifier of the module

()

Source from the content-addressed store, hash-verified

76 * @returns {string} a unique identifier of the module
77 */
78 identifier() {
79 let identifier = super.identifier();
80
81 if (this.cssLayer) {
82 identifier += `|${this.cssLayer}`;
83 }
84
85 if (this.supports) {
86 identifier += `|${this.supports}`;
87 }
88
89 if (this.media) {
90 identifier += `|${this.media}`;
91 }
92
93 if (this.inheritance) {
94 // Append directly — same bytes as `|` + items.join("|"), without the
95 // intermediate `.map()` array + per-item strings (`identifier()` is
96 // uncached and called repeatedly per module).
97 for (let i = 0; i < this.inheritance.length; i++) {
98 const item = this.inheritance[i];
99 identifier += `|inheritance_${i}|${item[0] || ""}|${item[1] || ""}|${item[2] || ""}`;
100 }
101 }
102
103 if (this.exportType) {
104 identifier += `|${this.exportType}`;
105 }
106
107 // We generate extra code for HMR, so we need to invalidate the module
108 if (this.hot) {
109 identifier += `|${this.hot}`;
110 }
111
112 return identifier;
113 }
114
115 /**
116 * Returns a human-readable identifier for this module.

Callers 1

renderChunkMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected