(err, stats)
| 638 | const compiler = webpack(mainConfig); |
| 639 | const [onceResolve, onceReject] = once(resolve, reject); |
| 640 | const cb: WebpackWatchHandler = async (err, stats) => { |
| 641 | if (tab && stats) { |
| 642 | tab.log( |
| 643 | stats.toString({ |
| 644 | colors: true, |
| 645 | }), |
| 646 | ); |
| 647 | } |
| 648 | if (this.config.jsonStats) { |
| 649 | await this.writeJSONStats( |
| 650 | 'main', |
| 651 | stats, |
| 652 | mainConfig.stats as WebpackToJsonOptions, |
| 653 | 'main', |
| 654 | ); |
| 655 | } |
| 656 | |
| 657 | if (err) return onceReject(err); |
| 658 | if (!watch && stats?.hasErrors()) { |
| 659 | return onceReject( |
| 660 | new Error( |
| 661 | `Compilation errors in the main process: ${stats.toString()}`, |
| 662 | ), |
| 663 | ); |
| 664 | } |
| 665 | |
| 666 | return onceResolve(undefined); |
| 667 | }; |
| 668 | if (watch) { |
| 669 | const watcher = compiler.watch({}, cb); |
| 670 | if (watcher) { |
nothing calls this directly
no test coverage detected