From f41cb3ae9cc5bf4909948b5abeebf6f5fa5df199 Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Mon, 9 Feb 2015 15:58:35 +0100 Subject: [PATCH] Use "supports-color" to detect if terminal supports colors This solution still supports "--colors" and "--no-colors" for overriding the detected ability. --- bin/webpack.js | 4 +--- package.json | 3 ++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/bin/webpack.js b/bin/webpack.js index 61c09398d..eb14f354d 100755 --- a/bin/webpack.js +++ b/bin/webpack.js @@ -77,9 +77,7 @@ ifArg("json", function(bool) { outputOptions.json = bool; }); -ifArg("colors", function(bool) { - outputOptions.colors = bool; -}); +outputOptions.colors = require("supports-color"); ifArg("sort-modules-by", function(value) { outputOptions.modulesSort = value; diff --git a/package.json b/package.json index 2da35f553..677fd1bb5 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,8 @@ "webpack-core": "~0.4.8", "node-libs-browser": "~0.4.0", "watchpack": "^0.2.1", - "tapable": "~0.1.8" + "tapable": "~0.1.8", + "supports-color": "^1.2.0" }, "licenses": [ {