Expose all html-minifier-terser options
- Dominant language
- Python
- Stars
- 3
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
All options from https://github.com/terser/html-minifier-terser should have equivalents.
Probably the best way is to actually run `html-minifier-terser --help` and parse these out then use this to generate a list of equivalent options that are passed directly to html-minifier-terser
```
html-minifier-terser --help
Usage: html-minifier-terser [options] [files...]
Options:
-V, --version output the version number
--case-sensitive Treat attributes in case sensitive manner (useful for SVG; e.g. viewBox)
--collapse-boolean-attributes Omit attribute values from boolean attributes
--collapse-inline-tag-whitespace Collapse white space around inline tag
--collapse-whitespace Collapse white space that contributes to text nodes in a document tree.
--conservative-collapse Always collapse to 1 space (never remove it entirely)
--continue-on-parse-error Handle parse errors instead of aborting
--custom-attr-assign Arrays of regex'es that allow to support custom attribute assign expressions (e.g. '
--custom-attr-collapse Regex that specifies custom attribute to strip newlines from (e.g. /ng-class/)
--custom-attr-surround Arrays of regex'es that allow to support custom attribute surround expressions (e.g. )
--custom-event-attributes Arrays of regex'es that allow to support custom event attributes for minifyJS (e.g. ng-click)
--decode-entities Use direct Unicode characters whenever possible
--no-html5 Parse input according to HTML5 specifications
--ignore-custom-comments Array of regex'es that allow to ignore certain comments, when matched
--ignore-custom-fragments Array of regex'es that allow to ignore certain fragments, when matched (e.g. , {{ ... }})
--no-include-auto-generated-tags Insert tags generated by HTML parser
--keep-closing-slash Keep the trailing slash on singleton elements
--max-line-length Max line length
--minify-css [value] Minify CSS in style elements and style attributes (uses clean-css)
--minify-js [value] Minify Javascript in script elements and on* attributes (uses terser)
--minify-urls [value] Minify URLs in various attributes (uses relateurl)
--no-newlines-before-tag-close Never add a newline before a tag that closes an element
--preserve-line-breaks Always collapse to 1 line break (never remove it entirely) when whitespace between tags include a line break.
--prevent-attributes-escaping Prevents the escaping of the values of attributes.
--process-conditional-comments Process contents of conditional comments through minifier
--process-scripts Array of strings corresponding to types of script elements to process through minifier (e.g. "text/ng-template", "text/x-handlebars-template", etc.)
--quote-character Type of quote to use for attribute values (' or ")
--remove-attribute-quotes Remove quotes around attributes when possible.
--remove-comments Strip HTML comments
--remove-empty-attributes Remove all attributes with whitespace-only values
--remove-empty-elements Remove all elements with empty contents
--remove-optional-tags Remove unrequired tags
--remove-redundant-attributes Remove attributes when value matches default.
--remove-script-type-attributes Removes the following attributes from script tags: text/javascript, text/ecmascript, text/jscript, application/javascript, application/x-javascript, application/ecmascript.
Other type attribute values are left intact
--remove-style-link-type-attributes Remove type="text/css" from style and link tags. Other type attribute values are left intact.
--remove-tag-whitespace Remove space between attributes whenever possible
--sort-attributes Sort attributes by frequency
--sort-class-name Sort style classes by frequency
--trim-custom-fragments Trim white space around ignoreCustomFragments.
--use-short-doctype Replaces the doctype with the short (HTML5) doctype
-o --output Specify output file (if not specified STDOUT will be used for output)
-c --config-file Use config file
--input-dir Specify an input directory
--output-dir Specify an output directory
--file-ext Specify an extension to be read, ex: html
-h, --help display help for command
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.