Problem/Motivation
In #3302755: On-the-fly JavaScript minification, we eventually came up with the following plan:
1. Pre-minify all core JavaScript, and add {minified: true} to the asset definition.
2. Minify any remaining JavaScript (in practice this will be js from contrib/custom modules and themes) on-the-fly using Peast.
Steps to reproduce
Proposed resolution
We already have foo.es6.js files and foo.js files which are generated by the build step. Modify the build step so that it removes whitespace and comments from the foo.js files. Add {minified: true} to the library definition for every file that relies on the build step.
Remaining tasks
It would be good to compare individual file sizes vs. the Peast numbers in #3302755: On-the-fly JavaScript minification.