From 77ad53208ed4a0b59abf0ddb651a8eeed9c03648 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 29 Aug 2024 18:36:30 -0600 Subject: [PATCH] ref: optimize for minifying harder --- README.md | 2 +- example.html | 4 ++-- package.json | 5 ++++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index df40cc0..5eb6d8e 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ The fastest, most lightweight, fewest dependency jQuery alternative. Development Build: 572B (types + comments) \ -Production Build: 146B (min + gz) +Production Build: 117B (min + gz) ## Example Usage diff --git a/example.html b/example.html index cc0d13a..a0185d8 100644 --- a/example.html +++ b/example.html @@ -15,9 +15,9 @@ console.log("globalThis.AJQuery:", globalThis.AJQuery); - + diff --git a/package.json b/package.json index 39d07ca..f702fb3 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,10 @@ "start": "open http://localhost/example.html && caddy file-server --browse --root .", "test": "node ./tests/", "--------": "---------------------------------------", - "build-all": "npx uglify-js ajquery.js -o ajquery.min.js && npx uglify-js ajquery.cjs -o ajquery.min.cjs && npx uglify-js ajquery.js -o ajquery.min.mjs", + "build-all": "npm run build-js && npm run build-cjs && npm run build-mjs", + "build-js": "npx -p uglify-js@3 uglifyjs --compress 'assignments' --mangle reserved='[\"$\",\"$$\",\"require\",\"exports\"]' ajquery.js -o ajquery.min.js", + "build-cjs": "npx -p uglify-js@3 uglifyjs --compress 'assignments' --mangle reserved='[\"$\",\"$$\",\"require\",\"exports\"]' ajquery.cjs -o ajquery.min.cjs", + "build-mjs": "npx -p uglify-js@3 uglifyjs --compress 'assignments' --mangle reserved='[\"$\",\"$$\"]' ajquery.mjs -o ajquery.min.mjs", "jshint": "npx -p jshint@2.x -- jshint -c ./.jshintrc ./ajquery.js ./ajquery.cjs ./ajquery.mjs", "prepare": "npm run build", "prepublish": "npm run reexport-types",