Support for ES6 minification
See original GitHub issueHi
the html-webpack-plugin
is making heavy use of html-minifier
to keep the html compact.
Now that many browsers support ES6 out of the box, people start using ES6 inside script tags.
According to @evilebottnawi from the webpack
team using ES6 is not possible because html-minifier
is not capable of parsing ES6: https://github.com/jantimon/html-webpack-plugin/issues/1262
When webpack
was faced with the same problem they made a switch to terser
which has now about 6 million downloads per week.
uglify-es is no longer maintained and uglify-js does not support ES6+.
terser is a fork of uglify-es that mostly retains API and CLI compatibility with uglify-es and uglify-js@3.
(taken from their official readme)
There was already a proposal to do the same change for the html-minifier
: #1034
It would mean to replace https://github.com/kangax/html-minifier/blob/51ce10f4daedb1de483ffbcccecc41be1c873da2/package.json#L63 with terser
Issue Analytics
- State:
- Created 4 years ago
- Reactions:12
- Comments:19 (3 by maintainers)
Top GitHub Comments
Workaround:
html-minifier-terser
v5.0.0 is released now: https://www.npmjs.com/package/html-minifier-terser