Skip to content

Commit

Permalink
chore: disable fsevents only on macos
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Jul 30, 2023
1 parent 6465918 commit 0e524c3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/vite-node/src/hmr/emitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ export function viteNodeHmrPlugin(): Plugin {
name: 'vite-node:hmr',

config() {
if (process.env.VITE_TEST_WATCHER_DEBUG) {
// chokidar fsevents is unstable on macos when emitting "ready" event
if (process.platform === 'darwin' && process.env.VITE_TEST_WATCHER_DEBUG) {
return {
server: {
watch: {
Expand Down
3 changes: 2 additions & 1 deletion packages/vitest/src/node/plugins/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ export async function VitestPlugin(options: UserConfig = {}, ctx = new Vitest('t
},
}

if (process.env.VITE_TEST_WATCHER_DEBUG) {
// chokidar fsevents is unstable on macos when emitting "ready" event
if (process.platform === 'darwin' && process.env.VITE_TEST_WATCHER_DEBUG) {
config.server!.watch!.useFsEvents = false
config.server!.watch!.usePolling = false
}
Expand Down

0 comments on commit 0e524c3

Please sign in to comment.