Expand description
Port of src/ast/minify.ts.
Selector parts are strings (Vec<String> per selector), lengths are utf-16 lengths like the javascript strings.
The typescript minification context ({ [key]: any }) is MinifyContext; the render size cache stored on the
options (options.cache) lives in the context: both belong to one minify() call.
Structs§
- Matched
Selector - matched selectors (
MatchedSelector) - Minify
Context - state of a minification (
context) - Minify
Options - options of a minification: the parser options and the registered features (
MinifyFeatureOptions)
Functions§
- merge_
rules - apply the minification rules to the ast tree
merge the adjacent rules without minifying the ast:
minify: falsewithmergeRules(seeParserOptions.merge_rules). the style rules that have the same selector, the keyframes rules that have the same selector, the at-rules that have the same name and prelude (not@font-face) and, depending onmergeRules, the rules that share declarations are merged. of the@keyframesthat have the same name, the last one is kept. the other minifications are not applied - minify
- apply the minification rules to the ast tree
- minify_
with minifywith registered features and a context- optimize_
selector - optimize a selector
- split_
rule - split a selector string into selectors of parts