medama-io / medama

Self-hostable, privacy-focused website analytics.
https://oss.medama.io
388 stars 8 forks source link

perf(tracker): use terser for minification #111

Closed ayuhito closed 3 months ago

ayuhito commented 3 months ago

This replaces Google Closure Compiler with Terser to minify the tracking code which significantly improved bundle size.

File Size Compressed (gzip) Compressed (brotli)
default.js (old) 1775 bytes (1.73kb) 895 bytes (0.87 KB) 733 bytes (0.72 KB)
default.js (new) 1583 bytes (1.55kb) 792 bytes (0.77 KB) 642 bytes (0.63 KB)

Additionally, since Closure Compiler was the only dependency we had that could not run on Bun, we can completely remove any references to Node.js in this whole repository for a much simpler development experience (this caused problems in CI previously).