What minification does
Minifying removes everything a JavaScript engine doesn't need — whitespace, comments, long local variable names — and rewrites code into shorter equivalents
(if (a) { b(); } becomes a&&b()). Typical savings are 30–60% before compression. Since servers also gzip or Brotli-compress
scripts, the status line shows the gzipped size too, which is what users actually download.
This uses Terser, the minifier behind webpack, Vite and Rollup builds, with modern syntax (classes, async/await, optional chaining, modules) fully supported.
Options
- Shorten variable names — renames local variables and functions. Global names and object properties are never renamed, so the code keeps working when other scripts use it.
- ES module — tick for code with
import/export; top-level names can then be shortened too. - Keep licence comments — keeps comments starting with
/*!or containing@license/@preserve, as most open-source licences require. - Remove console.* — strips logging calls from production code.
Syntax errors are reported with the line and column. Minify for production, but keep your original source — to read minified code again, the JavaScript beautifier restores formatting (though not the original names).
Is my data uploaded?
No. Minification runs in your browser, so nothing you add is sent to gratistools.be. See the privacy page for details.