Repository: gohugoio/hugo (language: go)

Issue:
Check watching of module config of modules
https://discourse.gohugo.io/t/hugo-server-not-watching-config-of-modules-since-0-112-0/45527


Discussion / hints:

Fix patch:
diff --git a/config/allconfig/load.go b/config/allconfig/load.go
index 91cf1eb056b..b997c28969d 100644
--- a/config/allconfig/load.go
+++ b/config/allconfig/load.go
@@ -79,6 +79,7 @@ func LoadConfig(d ConfigSourceDescriptor) (*Configs, error) {
 		if err := configs.transientErr(); err != nil {
 			return nil, fmt.Errorf("failed to create config from modules config: %w", err)
 		}
+		configs.LoadingInfo.ConfigFiles = append(configs.LoadingInfo.ConfigFiles, l.ModulesConfigFiles...)
 	} else if err := configs.transientErr(); err != nil {
 		return nil, fmt.Errorf("failed to create config: %w", err)
 	}


Test patch:
diff --git a/testscripts/commands/server__watch_moduleconfig.txt b/testscripts/commands/server__watch_moduleconfig.txt
new file mode 100644
index 00000000000..867669754f4
--- /dev/null
+++ b/testscripts/commands/server__watch_moduleconfig.txt
@@ -0,0 +1,19 @@
+hugo server --disableLiveReload  &
+
+waitServer
+stopServer
+wait
+! stderr .
+stdout 'Watching for config changes in.*mytheme'
+
+
+-- hugo.toml --
+title = "Hugo Server Test"
+baseURL = "https://example.org/"
+disableKinds = ["section", "page", "taxonomy", "term", "RSS", "sitemap", "robotsTXT", "404"]
+theme = "mytheme"
+-- layouts/index.html --
+foo: {{ .Site.Params.foo }}
+-- themes/mytheme/hugo.toml --
+[params]
+    foo = "bar"