Skip to content

pantoken / props-minify

props-minify

Beta

@pantoken/plugin-props-minify — whakaritea ngā huringa prune, flatten, me mangle mō --instui-* custom properties mā te taputapu kotahi applyMinify.

Ia putorino tuku CSS (generate scripts, renderers) ka whakamahi i applyMinify mō te mata whakakākahu pūmau, kāore e tango i te whakawhirinaki tika ki PostCSS.

He haumaru anake te Prune + mangle mō ngā kohinga tūmatanui i reira katoa ngā tohu var(--instui-*) and their definitions live in the same output. Mō ngā kaiwhakamahi kōnae motuhake (@pantoken/css + @pantoken/components loaded independently), whakamahia ko { flatten: true } anake.

Mangle across file boundaries: tukuna te pūrongo Map kotahi hei mangle.sharedManifest ki ia waea applyMinify e tukatuka ana i ngā kōnae CSS e uta tahi ana. Tukatuka tuatahi te pepa tohu (ka whakatō i te manifest), katahi ngā pepa rāngai.

Ngā tauira

Whakamahia ngā huringa e toru ki tētahi kohinga tūmatanui

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

Flatten anake (he haumaru mō ngā kaiwhakamahi kōnae motuhake)

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

Mangle i ngā kōnae e rua me taua mapi kotahi

ts
import { applyMinify } from "@pantoken/plugin-props-minify";
const manifest = new Map<string, string>();
const tokenCss = applyMinify(rawTokens, { mangle: { sharedManifest: manifest } });
const componentCss = applyMinify(rawComponents, { mangle: { sharedManifest: manifest } });

Ngā Atanga

Ngā Ingoa Momo

Ngā Taipūtī

Ngā Mahi