Skip to content

Commit fad4637

Browse files
committed
Use bundlephobia banner for minzipped size.
1 parent 7ec456b commit fad4637

File tree

5 files changed

+12
-34
lines changed

5 files changed

+12
-34
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# [X_ITE](https://create3000.github.io/x_ite/) X3D Browser
22

33
[![npm Version](https://badgen.net/npm/v/x_ite)](https://www.npmjs.com/package/x_ite)
4-
[![Build Size](https://create3000.github.io/x_ite/assets/img/badges/compressed.svg)](https://create3000.github.io/x_ite/features/)
4+
[![Build Size](https://img.shields.io/bundlephobia/minzip/x_ite)](https://bundlephobia.com/package/x_ite)
55
[![jsDelivr Hits](https://data.jsdelivr.com/v1/package/npm/x_ite/badge?style=rounded)](https://www.jsdelivr.com/package/npm/x_ite)
66
[![npm Downloads](https://badgen.net/npm/dm/x_ite)](https://npmtrends.com/x_ite)
77
[![DeepScan grade](https://deepscan.io/api/teams/23540/projects/26814/branches/855447/badge/grade.svg)](https://deepscan.io/dashboard#view=project&tid=23540&pid=26814&bid=855447)

build/bin/dist.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,16 @@ function main ()
4141
copy_files ();
4242
systemSync (`npx webpack`);
4343
html ();
44-
// curl -H "Accept-Encoding: br" -s "https://cdn.jsdelivr.net/npm/x_ite@latest/dist/x_ite.min.js" | wc -c | tr -d ' '
45-
systemSync (`brotli -4 dist/x_ite.min.mjs --stdout | wc -c`);
46-
systemSync (`du -h dist/x_ite.min.js`);
44+
45+
// Output package sizes:
46+
47+
const online = sh (`curl -H "Accept-Encoding: br" -s "https://cdn.jsdelivr.net/npm/x_ite@latest/dist/x_ite.min.js" | wc -c | tr -d ' '`) .trim ();
48+
const local = sh (`brotli -4 dist/x_ite.min.mjs --stdout | wc -c | tr -d ' '`) .trim ();
49+
const min = sh (`cat dist/x_ite.min.js | wc -c | tr -d ' '`) .trim ();
50+
51+
console .log (`Online: ${online .toLocaleString ("en")} bytes`);
52+
console .log (`Local: ${local .toLocaleString ("en")} bytes`);
53+
console .log (`Min: ${min .toLocaleString ("en")} bytes`);
4754
}
4855

4956
main ();

build/bin/release.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,6 @@ function docs (version)
4848
// curl -H "Accept-Encoding: br" -s "https://cdn.jsdelivr.net/npm/x_ite@latest/dist/x_ite.min.js" | wc -c | tr -d ' '
4949
const size = Math .floor (parseInt (sh (`brotli -q 4 dist/x_ite.min.mjs --stdout | wc -c`) .trim ()) / 1000);
5050

51-
if (size < 300)
52-
var color = "green";
53-
else if (size < 310)
54-
var color = "cyan";
55-
else
56-
var color = "blue";
57-
58-
systemSync (`wget -q -O - https://badgen.net/static/compressed/${size}KB/${color} > docs/assets/img/badges/compressed.svg`);
59-
6051
let config = sh (`cat 'docs/_config.yml'`);
6152

6253
config = config .replace (/\x_ite_latest_version:\s*[\d\.]+/sg, `x_ite_latest_version: ${version}`);

docs/_posts/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ tags: [Getting Started]
77
permalink: /
88
---
99
[![npm Version](https://badgen.net/npm/v/x_ite)](https://www.npmjs.com/package/x_ite){: .badge-link }
10-
[![Build Size](/assets/img/badges/compressed.svg)](/x_ite/features/){: .badge-link }
10+
[![Build Size](https://img.shields.io/bundlephobia/minzip/x_ite)](https://bundlephobia.com/package/x_ite){: .badge-link }
1111
[![jsDelivr Hits](https://data.jsdelivr.com/v1/package/npm/x_ite/badge?style=rounded)](https://www.jsdelivr.com/package/npm/x_ite){: .badge-link }
1212
[![npm Downloads](https://badgen.net/npm/dm/x_ite)](https://npmtrends.com/x_ite){: .badge-link }
1313
[![DeepScan grade](https://deepscan.io/api/teams/23540/projects/26814/branches/855447/badge/grade.svg)](https://deepscan.io/dashboard#view=project&tid=23540&pid=26814&bid=855447){: .badge-link }

docs/assets/img/badges/compressed.svg

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)