Terser shrinks a calculator's JavaScript from 17.8 KB to 7.8 KB
A developer who runs a small calculator website reduced a shared JavaScript file from 17.8 KB to 7.8 KB using the Terser minifier. The savings came mainly from stripping comments and whitespace, shortening local variable names, simplifying expressions, and removing dead code. The author kept the readable source as the master copy and shipped only the minified version, which matters because the file loads on every page and many visitors use slow mobile connections. After testing a full week on the live time card across desktop and phone, the totals matched the unminified version exactly. The author also warns that bugs should be fixed in the source and regenerated rather than edited in the minified output.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in