Skip to main content

Module minify

Module minify 

Source
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§

MatchedSelector
matched selectors (MatchedSelector)
MinifyContext
state of a minification (context)
MinifyOptions
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: false with mergeRules (see ParserOptions.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 on mergeRules, the rules that share declarations are merged. of the @keyframes that 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
minify with registered features and a context
optimize_selector
optimize a selector
split_rule
split a selector string into selectors of parts