Skip to content

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

函数: applyMinify()

applyMinify(css, options?): string

Beta

对样式表字符串应用自定义属性最小化转换。

根据 options 构建一个 PostCSS 插件数组并同步运行。插件顺序: pruneCustomPropsflattenPropertymangleCustomProps。当未设置任何选项时返回不变的输入。

参数

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