JS, CSS and HTML minifier
Minify JavaScript with Terser, and CSS and HTML with a careful whitespace and comment stripper. See the size before and after.
Questions
How is JavaScript minified?
With Terser, which removes comments and whitespace, shortens local variable names and simplifies code without changing what it does. Tick ES module if your file uses import or export so top-level names are handled correctly.
Is the CSS and HTML minification safe?
It is deliberately conservative. It removes comments and extra whitespace, keeps strings, url() values and spaces that change meaning (such as a :hover or calc(1px + 2px)), and leaves <pre>, <textarea>, <script> and <style> contents alone unless you ask it to minify inline styles. It does not rename classes or drop rules.
Should I keep license comments?
If you ship third-party code, yes. Comments that start with /*! or contain @license or @preserve are kept when the option is on, as many licenses require.