Skip to content

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

函式: applyMinify() ​

applyMinify(css, options?): string

Beta(測試)

將自訂屬性最小化轉換套用到樣式表字串。

從 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 });