Skip to content

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

ฟังก์ชัน: applyMinify()

applyMinify(css, options?): string

เบต้า

นำการแปลงย่อคุณสมบัติแบบกำหนดเองไปใช้กับสตริงสไตล์ชีต

สร้างอาร์เรย์ปลั๊กอิน PostCSS จาก options และรันแบบซิงโครนัส. ลำดับปลั๊กอิน: 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 });