What this minifier does
Removes // and /* */ comments and collapses whitespace while respecting strings, template literals and regex literals. Line breaks that may be needed for automatic semicolon insertion are kept, so code without semicolons still works. It does not rename variables; for production bundles use a full minifier such as a bundler's built-in one.
Is minification worth it?
Minification typically trims 10–40% of a text file. With gzip or Brotli compression on the server the gain shrinks, because compression already removes repetition, but minified files still compress slightly smaller and parse a little faster.