Skip to content

pantoken / mangle-custom-props

mangle-custom-props

Beta

@pantoken/plugin-mangle-custom-props — renome non pwopriyete koutim long yo an idantifyan sekansyèl minimal idantifyan.

Non token tankou --instui-component-alert-border-top-style fasil pou moun li men yo chè nan pakè minifye: non an menm se plis pase 40 bytes, repete nan definisyon an, chak apèl var(), ek chak enskripsyon @property. Plugin sa a ranplase chak non ki matche — atravè definisyon yo, referans var(), ak paramèt @property — pa yon idantifyan minimal (--a, --b, …, --aa, …), sa diminye overhead non yo apeprè 90%.

Non yo ranmase soti nan tout fich style la, klase alfabetikman pou yon map deterministik, epi asiyen yo sekansyèlman. Yon opsyon MangleCustomPropsOptions.sharedManifest pèmèt plizyè pas PostCSS separe pataje yon sèl map konsistan, konsa fichye CSS ki trete separeman e ki pral chaje ansanm ka modifye an sekirite ak menm non yo.

Egzanp

ts
import postcss from "postcss";
import { mangleCustomProps } from "@pantoken/plugin-mangle-custom-props";
const out = postcss([mangleCustomProps()]).process(css, { from: undefined }).css;

Entèfas

Alyas tip

Varyab