@nibcss/unplugin
One plugin for Vite, webpack, Rspack, Rollup and esbuild: every option, what it generates and how the dev server behaves.
Entry points#
import nib from "@nibcss/unplugin/vite";
import nib from "@nibcss/unplugin/webpack";
import nib from "@nibcss/unplugin/rspack";
import nib from "@nibcss/unplugin/rollup";
import nib from "@nibcss/unplugin/esbuild";Options#
Option | Default | What it does |
|---|---|---|
|
| compile static attributes into classes. |
|
| webpack/Rspack: append the runtime to the client entry |
|
| mount the diagnostics overlay in dev (needs |
| auto-detected | path to the config file |
| project sources | extra globs to scan, or skip |
| — | config fields that win over the file |
|
|
|
| auto-detected | tell the plugin which compiler is the browser bundle |
rewrite, in full#
Value | Markup after the build | Who applies the class |
|---|---|---|
|
| nobody — it is already there |
|
| nobody, but the runtime can re-resolve it when the config changes |
|
| the runtime, in the browser |
"keep" is the dev default because it is what makes a config edit apply to the page you already have
open.
What it generates#
Path | What it is |
|---|---|
| the stylesheet, served as |
| the resolved config, as a module and as data |
| a real package re-exporting it, so the import type-checks with no |
| webpack/Rspack: the runtime entry appended to the client bundle |
| dev only, |
Every generated file opens with /* eslint-disable */ and an @generated marker, and everything
lives inside node_modules — nothing to add to .gitignore.
Dev-server behaviour#
- A config edit is applied to the open page — the build pushes the new config and the new stylesheet over the dev channel, the page swaps the stylesheet and re-resolves its elements, and rules the change removed go away too.
- A source edit is a normal hot update.
- Diagnostics are served at
/__nib/warningsand pushed to the overlay as you type.