diff --git a/.changeset/strong-colts-confess.md b/.changeset/strong-colts-confess.md new file mode 100644 index 0000000..1c13bea --- /dev/null +++ b/.changeset/strong-colts-confess.md @@ -0,0 +1,5 @@ +--- +'steiger': patch +--- + +Fixed the file watcher crashing due to symlinks in node_modules diff --git a/packages/steiger/src/features/transfer-fs-to-vfs.ts b/packages/steiger/src/features/transfer-fs-to-vfs.ts index 21a4dcb..64729f3 100644 --- a/packages/steiger/src/features/transfer-fs-to-vfs.ts +++ b/packages/steiger/src/features/transfer-fs-to-vfs.ts @@ -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' @@ -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,