Guest User

Untitled

a guest
May 22nd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. webpack(config, (err, stats) => {
  2. if (err) {
  3. console.error(err.stack || err);
  4. if (err.details) {
  5. console.error(err.details);
  6. }
  7. return;
  8. }
  9.  
  10. const info = stats.toJson();
  11. if (stats.hasWarnings() || stats.hasErrors()) {
  12. const messages = [...info.warnings, ...info.errors];
  13. messages.forEach(message => console.log(chalk.red(message)));
  14. } else {
  15. console.log(chalk.green("\nšŸš€ All good. Bundles are a-ok!"));
  16. console.log(
  17. chalk.green("-----------------------------------------------------")
  18. );
  19. console.log(
  20. stats.toString({
  21. colors: true,
  22. modules: false,
  23. entrypoints: false
  24. })
  25. );
  26. console.log(
  27. chalk.green("-----------------------------------------------------")
  28. );
  29. }
  30. });
Add Comment
Please, Sign In to add comment