terser / html-minifier-terser

actively maintained fork of html-minifier - minify HTML, CSS and JS code using terser - supports ES6 code
https://terser.org/html-minifier-terser
MIT License
376 stars 30 forks source link

[Documentation] Difference between html-minifier-terser and original html-minifier #37

Closed yrtimiD closed 4 years ago

yrtimiD commented 4 years ago

It's not very clear what is the difference between this project and original html-minifier. Adding some motivations and explanations to the readme will help understand and do the switch.

DanielRuf commented 4 years ago

Hi @yrtimiD,

the difference is that html-minifier-terser uses terser instead of uglify-js to support ES6 and newer.

See https://github.com/DanielRuf/html-minifier-terser/compare/v4.0.0...master and https://github.com/kangax/html-minifier/issues/1040 to understand the motivation behind this.

It has to do with the fact that the maintainer of html-minifier is also the maintainer of ugligy-js and he was not interested to move to terser which works (unlike uglify-es).

yrtimiD commented 4 years ago

Will be nice to have this explanation in the README.md

DanielRuf commented 4 years ago

I think the addition in the package name is sufficient. It is a direct replacement.

PRs for the README.md file are very welcome.

DanielRuf commented 4 years ago

Closing as obsolete as in my opinion the fork with terser is the current maintained solution and supports modern JavaScript. As terser was forked from uglify-es and the API is (mostly) the same there is not much to document.

See https://github.com/terser/terser#why-choose-terser

codepunkt commented 3 years ago

It was neither obvious to me that this is the maintained solution, nor why using terser would be better. You assume a lot of knowledge here that most developers will not have.

I specifically seached the issues and after reading this, will replace my current usage of html-minifier with this package.

I'd strongly suggest documenting this visibly in the README.