* Returns comment. * @param {object} options Information content of the comment * @param {string=} options.request request string used originally * @param {(string | null)=} options.chunkName name of the chunk referenced * @param {string=} options.chunkReason reason information of the chunk
({ request, chunkName, chunkReason, message, exportName })
| 517 | * @returns {string} comment |
| 518 | */ |
| 519 | comment({ request, chunkName, chunkReason, message, exportName }) { |
| 520 | /** @type {string} */ |
| 521 | let content; |
| 522 | if (this.outputOptions.pathinfo) { |
| 523 | content = [message, request, chunkName, chunkReason] |
| 524 | .filter(Boolean) |
| 525 | .map((item) => this.requestShortener.shorten(item)) |
| 526 | .join(" | "); |
| 527 | } else { |
| 528 | content = [message, chunkName, chunkReason] |
| 529 | .filter(Boolean) |
| 530 | .map((item) => this.requestShortener.shorten(item)) |
| 531 | .join(" | "); |
| 532 | } |
| 533 | if (!content) return ""; |
| 534 | if (this.outputOptions.pathinfo) { |
| 535 | return `${Template.toComment(content)} `; |
| 536 | } |
| 537 | return `${Template.toNormalComment(content)} `; |
| 538 | } |
| 539 | |
| 540 | /** |
| 541 | * Throw missing module error block. |
no test coverage detected