You are here

function advagg_js_alter in Advanced CSS/JS Aggregation 8.3

Same name and namespace in other branches
  1. 8.4 advagg.module \advagg_js_alter()
  2. 8.2 advagg.module \advagg_js_alter()
  3. 7.2 advagg.module \advagg_js_alter()

Implements hook_js_alter().

Pass the JavaScript array to the optimizer service.

File

./advagg.module, line 89
Advanced CSS/JS aggregation module.

Code

function advagg_js_alter(&$js) {

  // Skip if advagg is disabled.
  if (!advagg_enabled()) {
    return;
  }
  $js_optimizer = \Drupal::service('advagg.optimizer.js');
  $js_optimizer
    ->processAssetArray($js);
}