Skip to content

pantoken-root / plugins/postcss/props-minify/src / applyMinify

Funktion: applyMinify() ​

applyMinify(css, options?): string

Beta

Wendet Minifizierungs-Transformationen für Custom Properties auf einen Stylesheet-String an.

Erstellt ein PostCSS-Plugin-Array aus options und führt es synchron aus. Plugin-Reihenfolge: pruneCustomProps → flattenProperty → mangleCustomProps. Gibt die Eingabe unverändert zurück, wenn keine Optionen gesetzt sind.

Parameter ​

css ​

string

Der zu transformierende Stylesheet-String.

options? ​

PropsMinifyOptions = {}

PropsMinifyOptions.

Rückgabe ​

string

Der transformierte CSS-String.

Beispiel ​

ts
import { applyMinify } from "@pantoken/plugin-props-minify";
const out = applyMinify(css, { prune: true, flatten: true, mangle: true });