@nibcss/cli
Every command and flag of the nib CLI, the files it writes, and its Node API for custom pipelines.
Commands#
Command | What it does |
|---|---|
| create |
| scan once, write the stylesheet and the config files |
| the same, then rebuild on every change (about 50 ms) |
Flags#
Flag | Default | What it does |
|---|---|---|
|
| where the stylesheet goes; the config files are written beside it |
| project sources | globs to scan, repeatable; |
| off | strip comments and whitespace |
| auto-detected | a config file somewhere else |
What it writes#
File | For |
|---|---|
| the stylesheet — link it |
| sets |
| the same data as a module, plus |
The Node API#
import { build, watch, init } from "@nibcss/cli";
const result = await build({
out: "public/nib.css",
content: ["resources/views/**/*.blade.php"],
minify: true,
});
console.log(result); // what was written, and the engine stats
const watcher = await watch({ out: "public/nib.css", content: ["resources/views/**/*.blade.php"] });
// …
await watcher.close();Export | What it is |
|---|---|
| one pass |
| the same, then rebuild on change; |
| write the config file |
| the types |
This is what a Rails or Laravel pipeline reaches for when npm run is not where the build lives.