Same name in other branches
  1. 5.0.x advagg.module \advagg_js_alter()
  2. 6.0.x advagg.module \advagg_js_alter()
  3. 7.x-2.x advagg.module \advagg_js_alter()
  4. 8.x-2.x advagg.module \advagg_js_alter()
  5. 8.x-4.x advagg.module \advagg_js_alter()

Implements hook_js_alter().

Pass the JavaScript array to the optimizer service.

Fichier

./advagg.module, line 89

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);
}