import { type default } from "https://deno.land/x/astro_compress@v1.0.2/src/options/html.ts";
Index Signatures
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 (uses clean-css).
Minify JavaScript in script elements and event attributes (uses Terser).
Minify URLs in various attributes (uses relateurl).
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
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!