MCPcopy
hub / github.com/webpack/webpack / getShortModuleName

Function getShortModuleName

lib/ids/IdHelpers.js:88–98  ·  view source on GitHub ↗
(module, context, associatedObjectForCache)

Source from the content-addressed store, hash-verified

86 * @returns {string} short module name
87 */
88const getShortModuleName = (module, context, associatedObjectForCache) => {
89 const libIdent = module.libIdent({ context, associatedObjectForCache });
90 if (libIdent) return avoidNumber(libIdent);
91 const nameForCondition = module.nameForCondition();
92 if (nameForCondition) {
93 return avoidNumber(
94 makePathsRelative(context, nameForCondition, associatedObjectForCache)
95 );
96 }
97 return "";
98};
99
100/**
101 * Gets long module name.

Callers 3

applyMethod · 0.85
getShortChunkNameFunction · 0.85
getLongChunkNameFunction · 0.85

Calls 3

avoidNumberFunction · 0.85
libIdentMethod · 0.45
nameForConditionMethod · 0.45

Tested by

no test coverage detected