* @param {Error[]} warnings warnings * @param {{ preventReloading: boolean }=} params extra params
(warnings, params)
| 505 | * @param {{ preventReloading: boolean }=} params extra params |
| 506 | */ |
| 507 | warnings(warnings, params) { |
| 508 | log.warn("Warnings while compiling."); |
| 509 | |
| 510 | const printableWarnings = warnings.map((error) => { |
| 511 | const { header, body } = formatProblem("warning", error); |
| 512 | |
| 513 | return `${header}\n${stripAnsi(body)}`; |
| 514 | }); |
| 515 | |
| 516 | sendMessage("Warnings", printableWarnings); |
| 517 | |
| 518 | for (let i = 0; i < printableWarnings.length; i++) { |
| 519 | log.warn(printableWarnings[i]); |
| 520 | } |
| 521 | |
| 522 | const overlayWarningsSetting = |
| 523 | typeof options.overlay === "boolean" |
| 524 | ? options.overlay |
| 525 | : options.overlay && options.overlay.warnings; |
| 526 | |
| 527 | if (overlayWarningsSetting) { |
| 528 | const warningsToDisplay = |
| 529 | typeof overlayWarningsSetting === "function" |
| 530 | ? warnings.filter(overlayWarningsSetting) |
| 531 | : warnings; |
| 532 | |
| 533 | if (warningsToDisplay.length) { |
| 534 | overlay.send({ |
| 535 | type: "BUILD_ERROR", |
| 536 | level: "warning", |
| 537 | messages: warnings, |
| 538 | }); |
| 539 | } |
| 540 | } |
| 541 | |
| 542 | if (params && params.preventReloading) { |
| 543 | return; |
| 544 | } |
| 545 | |
| 546 | reloadApp(options, status); |
| 547 | }, |
| 548 | /** |
| 549 | * @param {Error[]} errors errors |
| 550 | */ |
nothing calls this directly
no test coverage detected
searching dependent graphs…