Skip to content

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

Funksjon: applyMinify() ​

applyMinify(css, options?): string

Beta

Bruk minifiseringstransformasjonar for custom properties på ein stylesheet-streng.

Byggjer eit PostCSS-plugin-array frå options og køyrer det synkront. Plugin-rekkefølgje: pruneCustomProps → flattenProperty → mangleCustomProps. Returnerer input uendra når ingen alternativ er sett.

Parametrar ​

css ​

string

Stylesheet-strengen som skal transformast.

options? ​

PropsMinifyOptions = {}

PropsMinifyOptions.

Returnerer ​

string

Den transformerte CSS-strengen.

Døme ​

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