Optional
caseTreat attributes in case sensitive manner (useful for custom HTML tags)
false
Optional
collapseOmit attribute values from boolean attributes
false
Optional
collapseDon't leave any spaces between display:inline; elements when collapsing. Must be used in conjunction with collapseWhitespace=true
false
Optional
collapseCollapse white space that contributes to text nodes in a document tree
false
Optional
conservativeAlways collapse to 1 space (never remove it entirely). Must be used in conjunction with collapseWhitespace=true
false
Optional
continueHandle parse errors
false
Optional
customArrays of regex'es that allow to support custom attribute assign expressions (e.g. '<div flex?="{{mode != cover}}"></div>'
)
[]
Optional
customRegex that specifies custom attribute to strip newlines from (e.g. /ng-class/
Optional
customArrays of regex'es that allow to support custom attribute surround expressions (e.g. <input {{#if value}}checked="checked"{{/if}}>
)
[]
Optional
customArrays of regex'es that allow to support custom event attributes for minifyJS
(e.g. ng-click
)
[/^on[a-z]{3,}$/]
Optional
decodeUse direct Unicode characters whenever possible
false
Optional
html5Parse input according to HTML5 specifications
true
Optional
ignoreArray of regex'es that allow to ignore certain comments, when matched
[ /^!/, /^\s*#/ ]
Optional
ignoreArray of regex'es that allow to ignore certain fragments, when matched (e.g. <?php ... ?>
, {{ ... }}
, etc.)
[/<%[\s\S]*?%>/, /<\?[\s\S]\*?\?>/]
Optional
includeInsert tags generated by HTML parser
true
Optional
keepKeep the trailing slash on singleton elements
false
Optional
maxSpecify a maximum line length. Compressed output will be split by newlines at valid HTML split-points
Optional
minifyCSSMinify CSS in style elements and style attributes
Optional
type: stringfalse
Optional
minifyJSMinify JavaScript in script elements and event attributes
Optional
inline: booleanfalse
Optional
minifyURLsMinify URLs in various attributes
false
Optional
noNever add a newline before a tag that closes an element
false
Optional
preserveAlways collapse to 1 line break (never remove it entirely) when whitespace between tags include a line break.
Must be used in conjunction with collapseWhitespace=true
false
Optional
preventPrevents the escaping of the values of attributes
false
Optional
processProcess contents of conditional comments through minifier
false
Optional
processArray of strings corresponding to types of script elements to process through minifier
(e.g. text/ng-template
, text/x-handlebars-template
, etc.)
[]
Optional
quoteType of quote to use for attribute values (' or ")
Optional
removeRemove quotes around attributes when possible
false
Optional
removeStrip HTML comments
false
Optional
removeRemove all attributes with whitespace-only values
false
Optional
removeRemove all elements with empty contents
false
Optional
removeRemove optional tags
false
Optional
removeRemove attributes when value matches default
false
Optional
removeRemove type="text/javascript"
from script
tags. Other type
attribute values are left intact
false
Optional
removeRemove type="text/css"
from style
and link
tags. Other type
attribute values are left intact
false
Optional
removeRemove space between attributes whenever possible. Note that this will result in invalid HTML!
false
Optional
sortSort attributes by frequency
false
Optional
sortSort style classes by frequency
false
Optional
trimTrim white space around ignoreCustomFragments
false
Optional
useReplaces the doctype
with the short (HTML5) doctype
false
Generated using TypeDoc
Most of the options are disabled by default