https://gitlab.haskell.org/ghc/ghc/-/merge_requests/14473 is adding a new addDependentDirectory method to TemplateHaskell. This is analagous to the addDependentFile method that TemplateHaskell already has.
stack has quite good support for the existing addDependentFile method through it's use of .hi parsing.
This ticket is to track adding similar support for addDependentDirectory