Skip to content

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

関数: applyMinify() ​

applyMinify(css, options?): string

ベータ

カスタムプロパティの最小化変換をスタイルシート文字列に適用します。

options から PostCSS プラグイン配列を構築し、同期的に実行します。プラグインの順序: pruneCustomProps → flattenProperty → mangleCustomProps。オプションが設定されていない場合は入力を変更せずに返します。

パラメーター ​

css ​

string

変換するスタイルシートの文字列。

options? ​

PropsMinifyOptions = {}

PropsMinifyOptions.

戻り値 ​

string

変換された CSS 文字列。

例 ​

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