Skip to content

Instantly share code, notes, and snippets.

@kendaganio
Created May 17, 2018 11:39
Show Gist options
  • Save kendaganio/7f9e4105eb0b2b557330cf62274cc641 to your computer and use it in GitHub Desktop.
Save kendaganio/7f9e4105eb0b2b557330cf62274cc641 to your computer and use it in GitHub Desktop.
webpack(config, (err, stats) => {
if (err) {
console.error(err.stack || err);
if (err.details) {
console.error(err.details);
}
return;
}
const info = stats.toJson();
if (stats.hasWarnings() || stats.hasErrors()) {
const messages = [...info.warnings, ...info.errors];
messages.forEach(message => console.log(chalk.red(message)));
} else {
console.log(chalk.green("\n🚀 All good. Bundles are a-ok!"));
console.log(
chalk.green("-----------------------------------------------------")
);
console.log(
stats.toString({
colors: true,
modules: false,
entrypoints: false
})
);
console.log(
chalk.green("-----------------------------------------------------")
);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment