Skip to content

UnoCSS CLI

De command line interface voor UnoCSS: @unocss/cli.

  • 🍱 Geschikt voor traditionele backends zoals Laravel of Kirby
  • 👀 Watch mode inbegrepen
  • 🔌 Ondersteunt aangepaste configuraties via uno.config.ts

Installatie

Dit pakket wordt geleverd met het unocss pakket:

bash
pnpm add -D unocss
bash
yarn add -D unocss
bash
npm install -D unocss
bash
bun add -D unocss

Je kunt ook het standalone pakket installeren:

bash
pnpm add -D @unocss/cli
bash
yarn add -D @unocss/cli
bash
npm install -D @unocss/cli
bash
bun add -D @unocss/cli

INFO

Als je de binary niet kunt vinden (bijv. met pnpm en alleen unocss is geïnstalleerd), moet je het @unocss/cli standalone pakket expliciet installeren.

Gebruik

Je kunt ook meerdere glob patronen doorgeven aan @unocss/cli:

bash
unocss "site/snippets/**/*.php" "site/templates/**/*.php"

Voorbeeld package configuratie:

INFO

Zorg ervoor dat je escape quotes toevoegt aan je npm script glob patronen.

json
{
  "scripts": {
    "build": "unocss \"src/**/*.html\" \"src/**/*.tsx\" --out-file dist/uno.css",
    "watch": "unocss \"src/**/*.html\" \"src/**/*.tsx\" --out-file dist/uno.css --watch"
  }
}

Opties

Je kunt opties doorgeven via de CLI:

bash
unocss --help

--config/-c

Specificeer het configuratiebestand. Standaard zoekt het naar uno.config.ts.

bash
unocss -c ./uno.config.ts

--out-file/-o

Specificeer het outputbestand.

bash
unocss -o uno.css

--watch/-w

Watch modus inschakelen.

bash
unocss -w

--preflight

Preflights inschakelen als inline CSS.

--minify

Minified output.

--no-merge

Schakel het samenvoegen van CSS regels uit.

--css-only

Genereer alleen de CSS output, zonder de virtuele module.

Configuraties

Voor meer informatie over hoe je UnoCSS kunt configureren, bekijk de Configuratie documentatie.

Released under the MIT License.