MCPcopy
hub / github.com/electron/forge / cb

Method cb

packages/plugin/webpack/src/WebpackPlugin.ts:640–667  ·  view source on GitHub ↗
(err, stats)

Source from the content-addressed store, hash-verified

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) {

Callers

nothing calls this directly

Calls 2

writeJSONStatsMethod · 0.95
logMethod · 0.80

Tested by

no test coverage detected