I don't understand your answer here. The question was how to deal with all those dependencies and the overhead in useless files. IMHO the best start would be trying to reduce the number of dependencies. Especially this part:
That will also fix the need to have a specific version of that module installed. Of course that may be possible for a few modules only, but that's what I would do as a C programmer
This means analyzing why each module is used. Often only a very limited number of functions from a particular module are actually used; in this case these functions could be added to a LMS module.
Comment