Build: Switch the minifier from UglifyJS to Terser
commit27303c6be09b8fc24c13454deae234e480cbf995
authorMichał Gołębiowski-Owczarek <m.goleb@gmail.com>
Wed, 31 May 2023 16:59:35 +0000 (31 18:59 +0200)
committerGitHub <noreply@github.com>
Wed, 31 May 2023 16:59:35 +0000 (31 18:59 +0200)
tree16479591d00d12db7f3e4341c10a35111835ecef
parent988a56847de301ce18a653f84b07c5af432a269f
Build: Switch the minifier from UglifyJS to Terser

UglifyJS is ES5-only, while Terser supports newer ECMAScript versions. jQuery
is authored in ES5 but jQuery 4.x will also have an ESM build that cannot be
minified using UglifyJS directly.

We could strip the `export` statement, minify via UglifyJS and re-add one but
that increases complexity & may not fully play nice with source maps.

On the other hand, switching to Terser increases the minfied size by just 324
bytes and the minified gzipped one by just 70 bytes. Such differences largely
disappear among bigger size gains from the `3.x-stable` line - around 2.7 KB
minified gzipped as of now.

Closes gh-5258
Gruntfile.js
build/tasks/build.js
build/tasks/sourcemap.js
package.json