First off, thanks for the great module!

Problem/Motivation

Scripts are flagged as not minified

Proposed resolution

Minify the scripts

Hello, would it be possible to minify the script included in the google_tag module, or would it be an option to pass them through a minification process when the site is built please?

Many thanks

CommentFileSizeAuthor
#2 js.zip1.12 KBtelegraph

Issue fork google_tag-3585488

Command icon 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

telegraph created an issue. See original summary.

telegraph’s picture

Status: Active » Needs review
StatusFileSize
new1.12 KB

Initially attached the minified scripts here, but was eventually able to create an MR

telegraph’s picture

Status: Needs review » Needs work

As an alternative solution to providing minified scripts, could the scripts please be processed by the Drupal core CSS and JS aggregation/minification functionality?

telegraph’s picture

Status: Needs work » Active
jnycz’s picture

I am seeing the same flags in Semrush, one for each page so thousands in my case. Needed feature.

platinum1’s picture

The larger the site, the larger the impact...

berdir’s picture

Status: Active » Needs work

This would be extremely annoying to maintain combined with other changes to those files like this.

I don't understand why preprocess is off for these scripts, it's been like that since the massive initial commit of the 2.x branch and I never understood why. So yes, does anything break if you just remove the preprocess flag? I'd also want to verify how this works together with the

#3565258: Support library-specific aggregates would allow for them to still be put in a separate aggregate file.

telegraph’s picture

Category: Feature request » Task
Status: Needs work » Needs review

Made an MR attempt at turning on preprocess and adding 'library-specific aggregates' as indicated in the linked issue

telegraph’s picture

steinmb’s picture

library-specific aggregates is introduced in version: 11.5.0 so if implemented, this version have to define 11.5.0 as minimum version?

berdir’s picture

Earlier versions will just not optimize it accordingly and will include it in the many regular variations of the JS aggregates, but it should still work. I haven't manually tested that though.