diff --git a/bin/cli.js b/bin/cli.js index e1d472d37d8..b05c59fa00a 100755 --- a/bin/cli.js +++ b/bin/cli.js @@ -80,9 +80,7 @@ For more information, see https://webpack.js.org/api/cli/.`); type: "boolean", alias: "colors", default: function supportsColor() { - if (process.stdout.isTTY === true) { - return require("supports-color").supportsColor; - } + return require("supports-color").stdout; }, group: DISPLAY_GROUP, describe: "Enables/Disables colors on the console" @@ -324,10 +322,7 @@ For more information, see https://webpack.js.org/api/cli/.`); } }); - if ( - typeof outputOptions.colors === "undefined" && - process.stdout.isTTY === true - ) + if (typeof outputOptions.colors === "undefined") outputOptions.colors = require("supports-color").stdout; ifArg("sort-modules-by", function(value) {