aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorMichał Gołębiowski-Owczarek <m.goleb@gmail.com>2023-05-31 18:59:35 +0200
committerGitHub <noreply@github.com>2023-05-31 18:59:35 +0200
commit27303c6be09b8fc24c13454deae234e480cbf995 (patch)
tree16479591d00d12db7f3e4341c10a35111835ecef /build
parent988a56847de301ce18a653f84b07c5af432a269f (diff)
downloadjquery-27303c6be09b8fc24c13454deae234e480cbf995.tar.gz
jquery-27303c6be09b8fc24c13454deae234e480cbf995.zip
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
Diffstat (limited to 'build')
-rw-r--r--build/tasks/build.js2
-rw-r--r--build/tasks/sourcemap.js2
2 files changed, 2 insertions, 2 deletions
diff --git a/build/tasks/build.js b/build/tasks/build.js
index bcfa8ceae..98d95cbe5 100644
--- a/build/tasks/build.js
+++ b/build/tasks/build.js
@@ -339,6 +339,6 @@ module.exports = function( grunt ) {
"";
grunt.log.writeln( "Creating custom build...\n" );
- grunt.task.run( [ "build:*:*" + ( modules ? ":" + modules : "" ), "uglify", "dist" ] );
+ grunt.task.run( [ "build:*:*" + ( modules ? ":" + modules : "" ), "terser", "dist" ] );
} );
};
diff --git a/build/tasks/sourcemap.js b/build/tasks/sourcemap.js
index 509374f2e..f6ef5698e 100644
--- a/build/tasks/sourcemap.js
+++ b/build/tasks/sourcemap.js
@@ -3,7 +3,7 @@
var fs = require( "fs" );
module.exports = function( grunt ) {
- var config = grunt.config( "uglify.all.files" );
+ var config = grunt.config( "terser.all.files" );
grunt.registerTask( "remove_map_comment", function() {
var minLoc = grunt.config.process( Object.keys( config )[ 0 ] );