Skip to content

Commit

Permalink
Update to latest Colorette
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgebucaran committed Sep 24, 2021
1 parent 19e10fc commit 2ea614d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"@typescript-eslint/parser": "^4.14.1",
"@webpack-cli/migrate": "^1.1.2",
"coffeescript": "^2.5.1",
"colorette": "^1.2.1",
"colorette": "^2.0.8",
"concat-stream": "^2.0.0",
"cz-customizable": "^6.3.0",
"del-cli": "^3.0.1",
Expand Down
14 changes: 7 additions & 7 deletions packages/webpack-cli/lib/webpack-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -992,15 +992,15 @@ class WebpackCLI {
this.program.on("option:color", function () {
const { color } = this.opts();

cli.utils.colors.options.changed = true;
cli.utils.colors.options.enabled = color;
cli.isColorSupportChanged = true;
cli.utils.colors.isColorSupported = color;
});
this.program.option("--no-color", "Disable colors on console.");
this.program.on("option:no-color", function () {
const { color } = this.opts();

cli.utils.colors.options.changed = true;
cli.utils.colors.options.enabled = color;
cli.isColorSupportChanged = true;
cli.utils.colors.isColorSupported = color;
});

// Make `-v, --version` options
Expand Down Expand Up @@ -1962,16 +1962,16 @@ class WebpackCLI {
let colors;

// From arguments
if (typeof this.utils.colors.options.changed !== "undefined") {
colors = Boolean(this.utils.colors.options.enabled);
if (typeof this.isColorSupportChanged !== "undefined") {
colors = Boolean(this.utils.colors.isColorSupported);
}
// From stats
else if (typeof configOptions.stats.colors !== "undefined") {
colors = configOptions.stats.colors;
}
// Default
else {
colors = Boolean(this.utils.colors.options.enabled);
colors = Boolean(this.utils.colors.isColorSupported);
}

configOptions.stats.colors = colors;
Expand Down
2 changes: 1 addition & 1 deletion packages/webpack-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@webpack-cli/configtest": "^1.0.4",
"@webpack-cli/info": "^1.3.0",
"@webpack-cli/serve": "^1.5.2",
"colorette": "^1.2.1",
"colorette": "^2.0.8",
"commander": "^7.0.0",
"execa": "^5.0.0",
"fastest-levenshtein": "^1.0.12",
Expand Down

0 comments on commit 2ea614d

Please sign in to comment.