Skip to content

Commit 5fd58ea

Browse files
author
arnoson
committed
Use picocolors
1 parent d3d052a commit 5fd58ea

File tree

3 files changed

+11
-29
lines changed

3 files changed

+11
-29
lines changed

package-lock.json

Lines changed: 4 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
"module": "dist/index.js",
88
"exports": {
99
".": {
10-
"import": "./dist/index.js",
11-
"require": "./dist/index.cjs"
10+
"import": "./dist/index.js",
11+
"require": "./dist/index.cjs"
1212
}
13-
},
13+
},
1414
"types": "dist/index.d.ts",
1515
"scripts": {
1616
"build": "tsup src/index.ts --format esm,cjs --clean --dts"
@@ -36,7 +36,7 @@
3636
"vite": "^3.0.1"
3737
},
3838
"dependencies": {
39-
"chalk": "^5.0.1",
40-
"chokidar": "^3.5.0"
39+
"chokidar": "^3.5.0",
40+
"picocolors": "^1.0.0"
4141
}
4242
}

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Plugin, ViteDevServer } from 'vite'
22
import chokidar, { WatchOptions } from 'chokidar'
3-
import chalk from 'chalk'
3+
import colors from 'picocolors'
44
import path from 'path'
55

66
// https://github.com/vitejs/vite/blob/03b323d39cafe2baabef74e6051a9640add82590/packages/vite/src/node/server/hmr.ts
@@ -46,7 +46,7 @@ export default (
4646
ws.send({ type: 'full-reload', path: config.alwaysReload ? '*' : path })
4747
if (config.log ?? true) {
4848
logger.info(
49-
chalk.green(`page reload `) + chalk.dim(getShortName(path, root)),
49+
colors.green(`page reload `) + colors.dim(getShortName(path, root)),
5050
{ clear: true, timestamp: true }
5151
)
5252
}

0 commit comments

Comments
 (0)