Skip to content

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

Functie: applyMinify()

applyMinify(css, options?): string

Bèta

Pas minificatie-transformaties voor custom-properties toe op een stylesheet-tekst.

Stelt een PostCSS-pluginarray samen uit options en voert deze synchroon uit. Volgorde van plugins: pruneCustomPropsflattenPropertymangleCustomProps. Geeft de invoer ongewijzigd terug wanneer geen opties zijn ingesteld.

Parameters

css

string

De stylesheet-tekst die getransformeerd moet worden.

options?

PropsMinifyOptions = {}

PropsMinifyOptions.

Retourneert

string

De getransformeerde CSS-tekst.

Voorbeeld

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