Fix it so disable a module does not disable transitive dependency required by others

The motivation behind the original implementation was probably to show disabled modules when running `hugo mod graph`.

Fixes #11376
This commit is contained in:
Bjørn Erik Pedersen
2023-08-23 12:39:24 +02:00
parent 9a8c84d600
commit dcf425c846
8 changed files with 37 additions and 42 deletions

View File

@@ -84,7 +84,7 @@ func LoadConfig(d ConfigSourceDescriptor) (*Configs, error) {
return nil, fmt.Errorf("failed to create config: %w", err)
}
configs.Modules = moduleConfig.ActiveModules
configs.Modules = moduleConfig.AllModules
configs.ModulesClient = modulesClient
if err := configs.Init(); err != nil {
@@ -471,7 +471,7 @@ func (l *configLoader) loadModules(configs *Configs) (modules.ModulesConfig, *mo
ex := hexec.New(conf.Security)
hook := func(m *modules.ModulesConfig) error {
for _, tc := range m.ActiveModules {
for _, tc := range m.AllModules {
if len(tc.ConfigFilenames()) > 0 {
if tc.Watch() {
l.ModulesConfigFiles = append(l.ModulesConfigFiles, tc.ConfigFilenames()...)