(err, _compilation)
| 582 | * @returns {void} |
| 583 | */ |
| 584 | const onCompiled = (err, _compilation) => { |
| 585 | if (err) return finalCallback(err); |
| 586 | |
| 587 | const compilation = /** @type {Compilation} */ (_compilation); |
| 588 | |
| 589 | if (this.hooks.shouldEmit.call(compilation) === false) { |
| 590 | compilation.startTime = startTime; |
| 591 | compilation.endTime = Date.now(); |
| 592 | const stats = new Stats(compilation); |
| 593 | this.hooks.done.callAsync(stats, (err) => { |
| 594 | if (err) return finalCallback(err); |
| 595 | return finalCallback(null, stats); |
| 596 | }); |
| 597 | return; |
| 598 | } |
| 599 | |
| 600 | process.nextTick(() => { |
| 601 | logger = compilation.getLogger("webpack.Compiler"); |
| 602 | logger.time("emitAssets"); |
| 603 | this.emitAssets(compilation, (err) => { |
| 604 | /** @type {Logger} */ |
| 605 | (logger).timeEnd("emitAssets"); |
| 606 | if (err) return finalCallback(err); |
| 607 | |
| 608 | if (compilation.hooks.needAdditionalPass.call()) { |
| 609 | compilation.needAdditionalPass = true; |
| 610 | |
| 611 | compilation.startTime = startTime; |
| 612 | compilation.endTime = Date.now(); |
| 613 | /** @type {Logger} */ |
| 614 | (logger).time("done hook"); |
| 615 | const stats = new Stats(compilation); |
| 616 | this.hooks.done.callAsync(stats, (err) => { |
| 617 | /** @type {Logger} */ |
| 618 | (logger).timeEnd("done hook"); |
| 619 | if (err) return finalCallback(err); |
| 620 | |
| 621 | this.hooks.additionalPass.callAsync((err) => { |
| 622 | if (err) return finalCallback(err); |
| 623 | this.compile(onCompiled); |
| 624 | }); |
| 625 | }); |
| 626 | return; |
| 627 | } |
| 628 | |
| 629 | /** @type {Logger} */ |
| 630 | (logger).time("emitRecords"); |
| 631 | this.emitRecords((err) => { |
| 632 | /** @type {Logger} */ |
| 633 | (logger).timeEnd("emitRecords"); |
| 634 | if (err) return finalCallback(err); |
| 635 | |
| 636 | compilation.startTime = startTime; |
| 637 | compilation.endTime = Date.now(); |
| 638 | /** @type {Logger} */ |
| 639 | (logger).time("done hook"); |
| 640 | const stats = new Stats(compilation); |
| 641 | this.hooks.done.callAsync(stats, (err) => { |
nothing calls this directly
no test coverage detected