Skip to content

Commit 01b178d

Browse files
authored
chore: migrate to nanocolors (#3865)
1 parent d20def5 commit 01b178d

File tree

3 files changed

+81
-16
lines changed

3 files changed

+81
-16
lines changed

lib/Server.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1672,7 +1672,7 @@ class Server {
16721672
}
16731673

16741674
logStatus() {
1675-
const colorette = require("colorette");
1675+
const nanocolors = require("nanocolors");
16761676

16771677
const getColorsOption = (compilerOptions) => {
16781678
let colorsEnabled;
@@ -1683,7 +1683,7 @@ class Server {
16831683
) {
16841684
colorsEnabled = compilerOptions.stats;
16851685
} else {
1686-
colorsEnabled = colorette.options.enabled;
1686+
colorsEnabled = nanocolors.isColorSupported;
16871687
}
16881688

16891689
return colorsEnabled;
@@ -1692,14 +1692,14 @@ class Server {
16921692
const colors = {
16931693
info(useColor, msg) {
16941694
if (useColor) {
1695-
return colorette.cyan(msg);
1695+
return nanocolors.cyan(msg);
16961696
}
16971697

16981698
return msg;
16991699
},
17001700
error(useColor, msg) {
17011701
if (useColor) {
1702-
return colorette.red(msg);
1702+
return nanocolors.red(msg);
17031703
}
17041704

17051705
return msg;

package-lock.json

+76-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
"ansi-html-community": "^0.0.8",
3636
"bonjour": "^3.5.0",
3737
"chokidar": "^3.5.1",
38-
"colorette": "^1.2.2",
3938
"compression": "^1.7.4",
4039
"connect-history-api-fallback": "^1.6.0",
4140
"del": "^6.0.0",
@@ -45,6 +44,7 @@
4544
"http-proxy-middleware": "^2.0.0",
4645
"internal-ip": "^6.2.0",
4746
"ipaddr.js": "^2.0.1",
47+
"nanocolors": "^0.1.12",
4848
"open": "^8.0.9",
4949
"p-retry": "^4.5.0",
5050
"portfinder": "^1.0.28",

0 commit comments

Comments
 (0)