Manual:Hooks/ResourceLoaderRegisterModules

Details

 * &$resourceLoader - The ResourceLoader object.

Usage
ResourceLoaderModule objects, which provide access to scripts, styles, and messages can be added to the ResourceLoader at this point. A common use case is registering a resource with "soft" dependencies on other extensions and classes. For example, a module can depend on an EventLogging schema only if EventLogging is installed. Using this hook allows adding tothe dependencies array conditionally before registering the module. For a single registration:

Instead of a ResourceLoaderFileModule you can pass in an array of 'script', 'styles', 'localBasePath', etc. as you do when appending an item to $wgResourceModules.

For multiple registrations:

Note that for MW 1.26 and later, you can not modify $wgResourceModules using this hook listener.