MCPcopy
hub / github.com/webpack/webpack / generateHeader

Method generateHeader

lib/ModuleInfoHeaderPlugin.js:314–320  ·  view source on GitHub ↗

* Returns the header. * @param {Module} module the module * @param {RequestShortener} requestShortener request shortener * @returns {RawSource} the header

(module, requestShortener)

Source from the content-addressed store, hash-verified

312 * @returns {RawSource} the header
313 */
314 generateHeader(module, requestShortener) {
315 const req = module.readableIdentifier(requestShortener);
316 const reqStr = req.replace(/\*\//g, "*_/");
317 const reqStrStar = "*".repeat(reqStr.length);
318 const headerStr = `/*!****${reqStrStar}****!*\\\n !*** ${reqStr} ***!\n \\****${reqStrStar}****/\n`;
319 return new RawSource(headerStr);
320 }
321}
322
323module.exports = ModuleInfoHeaderPlugin;

Callers 1

applyMethod · 0.95

Calls 2

readableIdentifierMethod · 0.45
replaceMethod · 0.45

Tested by

no test coverage detected