Experimental function to concatenate lots of HTML dependencies' JavaScript files into one single one.
A number of caveats apply:
- Strict mode: Many JavaScript files contain
"use strict";
at the top of the file. This causes slightly different behavior in the JS engine. If the concatenated JS files have different expectations regarding strict mode, there could be problems. - Hosted scripts: This script does not attempt to concatenate JS files that are hosted on CDNs. Instead, they're left in their original form. It's possible that files we do concatenate, either assume that a CDN-hosted script is loaded before it itself is, or, the opposite.
combine_js
has a parameter that lets you decide whether to put the combined script first or last, there's no way for us to decide automatically (assuming there's even a right answer). - ES6 modules: We leave
type="module"
alone, because for ES6 modules the file boundarie