Skip to content

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

Funktion: applyMinify() ​

applyMinify(css, options?): string

Beta

Anvend minificering af brugerdefineret egenskab til en stylesheet-streng.

Bygger et PostCSS plugin-array fra options og kører det synkront. Plugin-rækkefølge: pruneCustomProps → flattenProperty → mangleCustomProps. Returnerer input uændret når ingen indstillinger er indstillet.

Parametre ​

css ​

string

Stylesheet-strengen til at transformere.

options? ​

PropsMinifyOptions = {}

PropsMinifyOptions.

Returnerer ​

string

Den transformerede CSS-streng.

Eksempel ​

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