Skip to content

Commit

Permalink
ref: optimize for minifying harder
Browse files Browse the repository at this point in the history
  • Loading branch information
coolaj86 committed Aug 30, 2024
1 parent 0635d41 commit 77ad532
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions example.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
console.log("globalThis.AJQuery:", globalThis.AJQuery);
</script>

<script type="module" src="./ajquery.min.mjs"></script>
<script type="module" src="./ajquery.mjs"></script>
<script type="module">
import AJQuery from "./ajquery.mjs";
import AJQuery from "./ajquery.min.mjs";
console.log("imported AJQuery", AJQuery);
</script>
</body>
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected] -- jshint -c ./.jshintrc ./ajquery.js ./ajquery.cjs ./ajquery.mjs",
"prepare": "npm run build",
"prepublish": "npm run reexport-types",
Expand Down

0 comments on commit 77ad532

Please sign in to comment.