diff --git a/bin/cmd.js b/bin/cmd.js index 74376fe2..92f0d7eb 100755 --- a/bin/cmd.js +++ b/bin/cmd.js @@ -63,8 +63,7 @@ program console.error(err); return; } - - console.log(stats.toString({ color: true })); + console.log(stats.toString(stats.compilation.options.stats)); if (!server) { startServer(); } @@ -84,7 +83,7 @@ program build .run(cmd, { userWebpackConfig, useBabelrc }) .then(function(stats) { - console.log(stats.toString({ color: true })); + console.log(stats.toString(stats.compilation.options.stats)); }) .catch(function(err) { console.error(err); diff --git a/lib/build.js b/lib/build.js index 6897392b..bf698910 100644 --- a/lib/build.js +++ b/lib/build.js @@ -115,7 +115,10 @@ function webpackConfig(dir, { userWebpackConfig, useBabelrc } = {}) { nodeEnv }, bail: true, - devtool: false + devtool: false, + stats: { + colors: true + } }; fs.readdirSync(dirPath).forEach(function(file) { if (file.match(/\.(m?js|ts)$/)) {