import { type MinifyOpts } from "https://deno.land/x/ter@0.6.5/deps.ts";
Most of the options are disabled by default
Properties
Treat attributes in case sensitive manner (useful for custom HTML tags)
Don't leave any spaces between display:inline; elements when collapsing. Must be used in conjunction with collapseWhitespace=true
Collapse white space that contributes to text nodes in a document tree
Always collapse to 1 space (never remove it entirely). Must be used in conjunction with collapseWhitespace=true
Arrays of regex'es that allow to support custom attribute assign expressions (e.g. '<div flex?="{{mode != cover}}"></div>'
)
Regex that specifies custom attribute to strip newlines from (e.g. /ng-class/
Arrays of regex'es that allow to support custom attribute surround expressions (e.g. <input {{#if value}}checked="checked"{{/if}}>
)
Arrays of regex'es that allow to support custom event attributes for minifyJS
(e.g. ng-click
)
Array of regex'es that allow to ignore certain comments, when matched
Array of regex'es that allow to ignore certain fragments, when matched (e.g. <?php ... ?>
, {{ ... }}
, etc.)
Specify a maximum line length. Compressed output will be split by newlines at valid HTML split-points
Minify CSS in style elements and style attributes
Minify JavaScript in script elements and event attributes
Minify URLs in various attributes
Never add a newline before a tag that closes an element
Always 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
Prevents the escaping of the values of attributes
Process contents of conditional comments through minifier
Array of strings corresponding to types of script elements to process through minifier
(e.g. text/ng-template
, text/x-handlebars-template
, etc.)
Remove all attributes with whitespace-only values
Remove type="text/javascript"
from script
tags. Other type
attribute values are left intact
Remove type="text/css"
from style
and link
tags. Other type
attribute values are left intact
Remove space between attributes whenever possible. Note that this will result in invalid HTML!