Run the generator before webpack; watch mode included.
Setup#
build.mjs
import { CSSGenerator } from 'nakshora';
import { writeFileSync } from 'node:fs';
const css = new CSSGenerator({ theme: {} }).generate({ minify: true });
writeFileSync('src/generated/nakshora.css', css);Workflow#
- Edit your theme/config
- Re-run generation (
npm run css) - Refresh the browser
Note. v2 has no watch mode — the v3 CLI added
nakshora dev with incremental rebuilds.