ResourceLoader's JS minifier (Wikimedia-Minify) doesn't minify code as efficiently as other minifiers (since it needs to be fast enough to execute on-the-fly). We could benefit from using the pre-minified versions of some external libraries, instead of letting our minifier minify them on-the-fly. We already do this for Vue.js and some related libraries. Note that we must still include the non-minified version alongside (see T217351, T257878).
Benefits:
- Smaller transfer size
Drawbacks:
- Increased effort when upgrading (should be minimal for libraries that we treat as foreign resources, where upgrading is mostly automated)
- Losing support for source maps, which was just implemented in T47514 (shouldn't be a big deal for most libraries that aren't often involved in production errors)
In this task I'd like to do this for the 'pako' library as an experiment and as an example. Other libraries might be worth doing too, but probably need case-by-case review.
This task is inspired by this comment: