can config be shared among different modules in multi module mode

I checked the document and mvc sample codes, in every sample, they all load config in Module.php of each module.

If different module needs different config, it's reasonable. If I want to use the same config, can I set it in index.php instead of Module.php?

I tested my guess, but failed, $config is not recgonized as an available variable.

I just want to confirm wether config can be loaded by $di->setShared('config', $config)

if can't ,I'll go back to load it in each module

Yes, if you want to share it you have to set it in index.php instead of module.php