Problem/Motivation
The main eu cookie JS file is loaded using 'defer', which is good for an optimized frontend, but since the file is not minified, it still gets flagged by tools like Lighthouse as something that is not fully optimized.
It als is not being picked up by Drupal's aggregation, nor by AdvAgg's minification, so you can't force it to 'optimize' in that way. This makes sense, since the cookie module is telling the script tag to load in a special way, another module interfering with that could run counter to the developer's intention or break stuff.
Proposed resolution
Since a deferred file is not being picked up by Drupal's aggregation, nor by AdvAgg's minification, it might be handy to add and load a minified/uglified version in the module directly.
Comments
Comment #2
rembrandx commentedComment #3
iancawthorne commented+1 for this suggestion.
Comment #4
iancawthorne commentedPossibly something that would be resolved outside of eu_cookie_compliance with these tickets:
https://www.drupal.org/project/drupal/issues/1587536 (aggregation)
https://www.drupal.org/project/advagg/issues/3072469 (minified)
I've tried the two patches suggested here: https://www.drupal.org/project/advagg/issues/3072469#comment-14141019 and they look to be working as desired.
Comment #5
svenryen commentedComment #6
svenryen commentedWe now provide a minified version of the javascript with 50% reduced file size.