Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli(color): fix color option #663

Merged
merged 1 commit into from
Oct 30, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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")
evenstensberg marked this conversation as resolved.
Show resolved Hide resolved
outputOptions.colors = require("supports-color").stdout;

ifArg("sort-modules-by", function(value) {
Expand Down