Skip to content

Commit 276ff5f

Browse files
ephemerjakebailey
andauthored
Clone watcher compiler configurations before comparison to prevent unintended recompilation (#1197)
Co-authored-by: Jake Bailey <[email protected]>
1 parent b1efe43 commit 276ff5f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

internal/execute/watcher.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ func (w *watcher) hasErrorsInTsConfig() bool {
5454
}
5555
return true
5656
}
57-
if !reflect.DeepEqual(w.options.CompilerOptions(), configParseResult.CompilerOptions()) {
57+
// CompilerOptions contain fields which should not be compared; clone to get a copy without those set.
58+
if !reflect.DeepEqual(w.options.CompilerOptions().Clone(), configParseResult.CompilerOptions().Clone()) {
5859
// fmt.Fprint(w.sys.Writer(), "build triggered due to config change", w.sys.NewLine())
5960
w.configModified = true
6061
}

0 commit comments

Comments
 (0)