MCPcopy
hub / github.com/webpack/webpack / _createIdentifier

Method _createIdentifier

lib/ContextModule.js:232–297  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

230 }
231
232 _createIdentifier() {
233 let identifier =
234 this.context ||
235 (typeof this.options.resource === "string" ||
236 this.options.resource === false
237 ? `${this.options.resource}`
238 : this.options.resource.join("|"));
239 if (this.options.resourceQuery) {
240 identifier += `|${this.options.resourceQuery}`;
241 }
242 if (this.options.resourceFragment) {
243 identifier += `|${this.options.resourceFragment}`;
244 }
245 if (this.options.mode) {
246 identifier += `|${this.options.mode}`;
247 }
248 if (!this.options.recursive) {
249 identifier += "|nonrecursive";
250 }
251 if (this.options.addon) {
252 identifier += `|${this.options.addon}`;
253 }
254 if (this.options.regExp) {
255 identifier += `|${this._prettyRegExp(this.options.regExp, false)}`;
256 }
257 if (this.options.include) {
258 identifier += `|include: ${this._prettyRegExp(
259 this.options.include,
260 false
261 )}`;
262 }
263 if (this.options.exclude) {
264 identifier += `|exclude: ${this._prettyRegExp(
265 this.options.exclude,
266 false
267 )}`;
268 }
269 if (this.options.referencedExports) {
270 identifier += `|referencedExports: ${JSON.stringify(
271 this.options.referencedExports
272 )}`;
273 }
274 if (this.options.chunkName) {
275 identifier += `|chunkName: ${this.options.chunkName}`;
276 }
277 if (this.options.groupOptions) {
278 identifier += `|groupOptions: ${JSON.stringify(
279 this.options.groupOptions
280 )}`;
281 }
282 if (this.options.namespaceObject === "strict") {
283 identifier += "|strict namespace object";
284 } else if (this.options.namespaceObject) {
285 identifier += "|namespace object";
286 }
287 if (this.options.attributes) {
288 identifier += `|importAttributes: ${JSON.stringify(this.options.attributes)}`;
289 }

Callers 1

constructorMethod · 0.95

Calls 1

_prettyRegExpMethod · 0.95

Tested by

no test coverage detected