How to Minify Your JavaScript
Compress JS by removing comments, whitespace and shortening names — often a 40-60% reduction.
Unminified JavaScript ships full variable names, comments and whitespace, so the browser downloads and parses far more than it needs to. Enable minification in your build, and serve the result with Brotli or gzip. On top of that, splitting the bundle so each page loads only its own code usually saves more than minification alone.
Why It Matters
Unminified JavaScript ships comments and long variable names the browser doesn't need, and JS is expensive to download and parse. Minification (and tree-shaking) cuts bytes and speeds up execution.
How to Fix
Build for production
Tree-shake and split
Code Fix
javascriptfunction calculateTotal(price, quantity) {
// multiply price by quantity
return price * quantity;
}function calculateTotal(t,a){return t*a}Platform-Specific Instructions
Enable "Minify JavaScript" in your caching plugin; test for breakage since some plugin scripts dislike combining.
Production builds minify + tree-shake automatically.
Fixed that one.
Now find the rest.
A free audit ranks every issue on your site by the score points it costs — and links each one straight to its guide.
Run a free audit