Created
May 17, 2018 11:39
-
-
Save kendaganio/7f9e4105eb0b2b557330cf62274cc641 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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