I find that scripts that depend on external scripts (usually 3rd party APIs and the such) fail when minified because the minified script is loaded first thing, while the external script is skipped and comes later. So the local scripts don’t have the objects/functions that they require and produce errors.
Yes manual minify mode exists, but I’m thinking that if you could move the external scripts to load prior to the combined, minified script you could still do it all automatically.
What if any external scripts were moved to a low priorty of wp_enqueue_scripts and the minified script came at a high priority on the same hook? Or what if there was an option to move the minified script to the footer? I don’t know how hard this would be, but if it weren’t to difficult it would be a big step in making the awesome auto-minify setting work for more people.
This user suggests a way to move the minifed script to the footer:
- The topic ‘FEATURE: move external scripts to before minified scripts’ is closed to new replies.