You are here

function asset_injector_library_info_build in Asset Injector 8.2

Same name and namespace in other branches
  1. 8 asset_injector.module \asset_injector_library_info_build()

Implements hook_library_info_build().

Map the library IDs defined in actual assets. Note that drupal prefixes the IDs with our module name so we must not do that here.

See also

asset_injector_page_attachments() to the

1 call to asset_injector_library_info_build()
asset_injector_css_alter in ./asset_injector.module
Implements hook_css_alter().

File

./asset_injector.module, line 83
Contains module asset_injector.

Code

function asset_injector_library_info_build() {
  $libraries = [];
  foreach (asset_injector_get_assets() as $asset) {
    if ($library_info = $asset
      ->libraryInfo()) {
      $libraries[$asset
        ->libraryNameSuffix()] = $library_info;
    }
  }
  \Drupal::moduleHandler()
    ->alter('asset_injector_library_info_build', $libraries);
  return $libraries;
}