Skip to content

Commit 38a755e

Browse files
committed
chore: update chokidar to v4
1 parent 241d17d commit 38a755e

File tree

3 files changed

+30
-64
lines changed

3 files changed

+30
-64
lines changed

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@
146146
"@types/node": "^22.10.2",
147147
"@types/postcss-prefix-selector": "^1.16.3",
148148
"@types/prompts": "^2.4.9",
149-
"chokidar": "^3.6.0",
149+
"chokidar": "^4.0.3",
150150
"conventional-changelog-cli": "^5.0.0",
151151
"cross-spawn": "^7.0.6",
152152
"debug": "^4.4.0",
@@ -205,7 +205,7 @@
205205
"optional": true
206206
}
207207
},
208-
"packageManager": "[email protected].1",
208+
"packageManager": "[email protected].2",
209209
"pnpm": {
210210
"peerDependencyRules": {
211211
"ignoreMissing": [

pnpm-lock.yaml

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

scripts/watchAndCopy.js

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { copy, remove } from 'fs-extra'
21
import { watch } from 'chokidar'
2+
import { copy, remove } from 'fs-extra'
33
import { normalizePath } from 'vite'
44

55
function toClientAndNode(method, file) {
@@ -18,14 +18,19 @@ function toDist(file) {
1818
}
1919

2020
// copy shared files to the client and node directory whenever they change.
21-
watch('src/shared/**/*.ts')
21+
watch('src/shared', {
22+
ignored: (path, stats) => stats?.isFile() && !path.endsWith('.ts')
23+
})
2224
.on('change', (file) => toClientAndNode('copy', file))
2325
.on('add', (file) => toClientAndNode('copy', file))
2426
.on('unlink', (file) => toClientAndNode('remove', file))
2527

2628
// copy non ts files, such as an html or css, to the dist directory whenever
2729
// they change.
28-
watch('src/client/**/!(*.ts|tsconfig.json)')
30+
watch('src/client', {
31+
ignored: (path, stats) =>
32+
stats?.isFile() && (path.endsWith('.ts') || path.endsWith('tsconfig.json'))
33+
})
2934
.on('change', (file) => copy(file, toDist(file)))
3035
.on('add', (file) => copy(file, toDist(file)))
3136
.on('unlink', (file) => remove(toDist(file)))

0 commit comments

Comments
 (0)