diff --git a/lib/compile.js b/lib/compile.js index 679bdee5dc..64da03dd0b 100644 --- a/lib/compile.js +++ b/lib/compile.js @@ -3,6 +3,7 @@ const _ = require('lodash'); const BbPromise = require('bluebird'); const webpack = require('webpack'); +const tty = require('tty'); module.exports = { compile() { @@ -20,7 +21,7 @@ module.exports = { const compileOutputPaths = []; const consoleStats = this.webpackConfig.stats || _.get(this, 'webpackConfig[0].stats') || { - colors: true, + colors: tty.isatty(process.stdout.fd), hash: false, version: false, chunks: false, diff --git a/lib/wpwatch.js b/lib/wpwatch.js index 4e10226267..2345a72423 100644 --- a/lib/wpwatch.js +++ b/lib/wpwatch.js @@ -3,6 +3,7 @@ const _ = require('lodash'); const BbPromise = require('bluebird'); const webpack = require('webpack'); +const tty = require('tty'); module.exports = { wpwatch() { @@ -23,7 +24,7 @@ module.exports = { const compiler = webpack(this.webpackConfig); const consoleStats = this.webpackConfig.stats || { - colors: true, + colors: tty.isatty(process.stdout.fd), hash: false, version: false, chunks: false,