Issue #1587536: JS aggregation should account for "async" and "defer"
Open
requested to merge issue/drupal-1587536:1587536-js-aggregation-async-defer-attributes into 11.x
4 unresolved threads
Closes #1587536
Merge request reports
Activity
added 2132 commits
-
4e473248...b06bf11b - 2131 commits from branch
project:11.x
- 01dcada9 - Issue #1587536: JS aggregation should account for "async" and "defer"
-
4e473248...b06bf11b - 2131 commits from branch
854 854 # $settings['migrate_file_public_path'] = ''; 855 855 # $settings['migrate_file_private_path'] = ''; 856 856 857 /** 858 * JavaScript libraries with these attributes will be aggregated together. 859 */ 860 $settings['aggregated_js_attributes'] = ['defer', 'async']; changed this line in version 5 of the diff
I added a CR: https://www.drupal.org/node/3526457
854 854 # $settings['migrate_file_public_path'] = ''; 855 855 # $settings['migrate_file_private_path'] = ''; 856 856 857 /** 858 * JavaScript libraries with these attributes will be aggregated together. 859 */ 860 $settings['aggregated_js_attributes'] = ['defer', 'async']; changed this line in version 5 of the diff
854 854 # $settings['migrate_file_public_path'] = ''; 855 855 # $settings['migrate_file_private_path'] = ''; 856 856 857 /** 858 * JavaScript libraries with these attributes will be aggregated together. 859 */ 860 $settings['aggregated_js_attributes'] = ['defer', 'async']; changed this line in version 5 of the diff
33 35 // Help ensure maximum reuse of aggregate files by only grouping 34 36 // together items that share the same 'group' value. 35 37 $group_keys = $item['preprocess'] ? [$item['type'], $item['group']] : FALSE; 38 39 // Enables aggregation for 'async' or 'defer' attributes. 40 if ($group_keys && !empty($item['attributes'])) { 41 foreach (array_keys($item['attributes']) as $attribute_key) { 42 if (in_array($attribute_key, Settings::get('aggregated_js_attributes', ['async', 'defer']))) { 43 $group_keys[] = $attribute_key; 44 } 45 else { 46 $group_keys = FALSE;
Please register or sign in to reply