Problem/Motivation
In youtube_cookies.libraries.yml, the onetrust and eu_cookie_compliance libraries declare their JS files with { minified: true }, but the actual JS files (js/onetrust.js and
js/eu_cookie_compliance.js) are not minified. They contain full comments, whitespace, readable variable names, and JSDoc blocks.
When minified: true is set, Drupal's asset pipeline skips its own minification/aggregation optimizations for those files, assuming they are already minified. This results in unoptimized JS being served to end users.
Steps to reproduce
- Open
youtube_cookies.libraries.yml. - Note that
onetrustlibrary declaresjs/onetrust.js: { minified: true }. - Note that
eu_cookie_compliancelibrary declaresjs/eu_cookie_compliance.js: { minified: true }. - Open the actual JS files and confirm they are not minified (contain comments, whitespace, JSDoc, etc.).
Proposed resolution
Remove the minified: true flag from both the onetrust and eu_cookie_compliance library definitions, or replace it with minified: false, so that Drupal can properly process these files during aggregation.
Issue fork youtube_cookies-3581360
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
eduardo morales albertiReady to review
Comment #4
frouco commentedComment #6
frouco commentedFixed on release 2.0.7