Skip to content

Commit

Permalink
Fix the file watcher crashing due to symlinks in node_modules
Browse files Browse the repository at this point in the history
  • Loading branch information
illright committed Jun 9, 2024
1 parent 5b7cba4 commit a4427c6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/strong-colts-confess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'steiger': patch
---

Fixed the file watcher crashing due to symlinks in node_modules
4 changes: 2 additions & 2 deletions packages/steiger/src/features/transfer-fs-to-vfs.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { join } from 'node:path'
import { join, sep } from 'node:path'
import chokidar from 'chokidar'
import type { Folder } from '@feature-sliced/filesystem'
import { isGitIgnored } from 'globby'
Expand All @@ -15,7 +15,7 @@ export async function createWatcher(path: string) {
const isIgnored = await isGitIgnored({ cwd: path })

const watcher = chokidar.watch(path, {
ignored: isIgnored,
ignored: (path) => path.split(sep).includes('node_modules') || isIgnored(path),
ignoreInitial: false,
alwaysStat: true,
awaitWriteFinish: true,
Expand Down

0 comments on commit a4427c6

Please sign in to comment.