Plugin UMD modules can depend on other ones, but the loading order currently is just how it is encountered when reading filesystem folders. This is an issue if, for example, CorePluginsAdmin is loaded before CoreHome when CorePluginsAdmin depends on CoreHome. This PR fixes this by:
import blahblah from 'CoreHome'. We did this before by using an object mapping
'CoreHome'with the object in
window(also 'CoreHome' currently). webpack also allows using a function instead of an object, so now we're using a function that will detect and remember when a plugin is imported.
Note: this PR does not currently detect cycles.
Added docs for this here: https://github.com/matomo-org/developer-documentation/pull/587