Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
(stats, config, logger) => {
// config.stats contains our own stats settings, added during buildWebpackConfig().
const json = stats.toJson(config.stats);
if (verbose) {
logger.info(stats.toString(config.stats));
} else {
logger.info(statsToString(json, config.stats));
}
if (stats.hasWarnings()) {
logger.warn(statsWarningsToString(json, config.stats));
}
if (stats.hasErrors()) {
logger.error(statsErrorsToString(json, config.stats));
}
};
// ...event,
success,
error,
baseOutputPath,
outputPath: baseOutputPath,
outputPaths: outputPaths && Array.from(outputPaths.values()) || [baseOutputPath],
} as BrowserBuilderOutput);
if (!success && useBundleDownleveling) {
// If using bundle downleveling then there is only one build
// If it fails show any diagnostic messages and bail
if (webpackStats && webpackStats.warnings.length > 0) {
context.logger.warn(statsWarningsToString(webpackStats, { colors: true }));
}
if (webpackStats && webpackStats.errors.length > 0) {
context.logger.error(statsErrorsToString(webpackStats, { colors: true }));
}
return finalize(success);
} else if (success) {
outputPaths = ensureOutputPaths(baseOutputPath, i18n);
let noModuleFiles: EmittedFiles[] | undefined;
let moduleFiles: EmittedFiles[] | undefined;
let files: EmittedFiles[] | undefined;
const scriptsEntryPointName = normalizeExtraEntryPoints(
options.scripts || [],
'scripts',
).map(x => x.bundleName);
if (isDifferentialLoadingNeeded && options.watch) {
.join('\n');
this.context.logger.info(statsTitle + jsonString);
} else {
const json = stats.toJson(statsConfig);
const jsonString = statsToString(json, statsConfig)
.split('\n')
.map(line => ' ' + line)
.join('\n');
this.context.logger.info(statsTitle + jsonString);
if (stats.hasWarnings()) {
this.context.logger.warn(statsWarningsToString(json, statsConfig));
}
if (stats.hasErrors()) {
this.context.logger.error(statsErrorsToString(json, statsConfig));
}
}
}
}
+ (options.verbose ? '\n' : '');
}
const statsString = options.verbose
? stats.toString(statsToOptions)
: statsToString(getStatsJson(), statsToOptions);
logger.info(statsTitle + statsString);
if (!options.verbose) {
if (stats.hasWarnings()) {
logger.warn(statsWarningsToString(getStatsJson(), statsToOptions));
}
if (stats.hasErrors()) {
logger.error(statsErrorsToString(getStatsJson(), statsToOptions));
}
}
logger.info('');
};
+ (options.verbose ? '\n' : '');
}
const statsString = options.verbose
? stats.toString(statsToOptions)
: statsToString(getStatsJson(), statsToOptions);
logger.info(statsTitle + statsString);
if (!options.verbose) {
if (stats.hasWarnings()) {
logger.warn(statsWarningsToString(getStatsJson(), statsToOptions));
}
if (stats.hasErrors()) {
logger.error(statsErrorsToString(getStatsJson(), statsToOptions));
}
}
logger.info('');
};