v1.0.0
·
194 commits
to master
since this release
1.0.0 (2020-03-19)
Please note this is a completely rewritten loader, it is not based on https://github.com/webpack-contrib/html-loader/releases/tag/v1.0.0-alpha.0
⚠ BREAKING CHANGES
- for parsing HTML now we use
htmlparser2package - the
attrsoption was renamed to theattributesoption - the
interpolateoption was removed, please consider migration on thepreprocessor - the
minimizeoption istrueby default inproductionmode. You need to list all options forhtml-minifierif you useobjectnotation. - uppercase tags and uppercase attributes are handled by default
- the
rootoption was moved under theattributesoption, please look at the documentation - emit an error on broken HTML syntax when minimization is enabled
- By default, now we process the following tags with attributes:
- the
srcattribute of theaudiotag - the
srcattribute of theembedtag - the
srcattribute of theimgtag - the
srcsetattribute of theimgtag - the
srcattribute of theinputtag - the
hrefattribute of thelinktag (only for stylesheets) - the
dataattribute of theobjecttag - the
srcattribute of thescripttag - the
srcattribute of thesourcetag - the
srcsetattribute of thesourcetag - the
srcattribute of thetracktag - the
posterattribute of thevideotag - the
srcattribute of thevideotag
- the
- the
attributesoption should beBooleanorObject, please look at the documentation - the
exportAsDefaultoption were removed in favor theesModulesoption - the
exportAsEs6Defaultoption were removed in favor theesModulesoption
Features
- handle more tags and attributes
- added the
preprocessoroption - added the
esModuleoption - add the
rulFilteroption for filtering some of urls, please look at the documentation - allow to setup how to handle and filter tags and attributes, please look at the documentation
- improve error reporting
Bug Fixes
- adding quotes when necessary for unquoted sources
- do not handle empty attributes
- escape
\u2028and\u2029characters - handle only valid srcset tags
- parser tags and attributes according spec
- reduce
import/requirecount - reduce size of generated modules
- respect
#hashin sources - support ES6 syntax in
scripttags when minimize - support ES6 import of urls