From 0a2b83ebfccf748a8b4653677a8beb6860387a56 Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Fri, 30 May 2025 11:41:04 -0700 Subject: [PATCH] Use packageDir in watch globbing --- internal/project/watch.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/internal/project/watch.go b/internal/project/watch.go index 2098f0fd82..6564dadcfb 100644 --- a/internal/project/watch.go +++ b/internal/project/watch.go @@ -91,7 +91,18 @@ func createGlobMapper(host ProjectHost) func(data map[tspath.Path]string) []stri if w == nil { continue } - globSet[w.dir] = globSet[w.dir] || !w.nonRecursive + + dir := w.dir + if w.packageDir != nil && w.packageDirPath != nil { + real := host.FS().Realpath(*w.packageDir) + realPath := tspath.ToPath(real, "", host.FS().UseCaseSensitiveFileNames()) + + if realPath != *w.packageDirPath { + dir = real + } + } + + globSet[dir] = globSet[dir] || !w.nonRecursive } globs := make([]string, 0, len(globSet))