@teacss/bun
v0.10.11
Published
Bun.build plugin for TeaCSS: virtual:teacss.css and the entry's @teacss become the CSS the Rust engine generates
Readme
@teacss/bun
The Bun.build plugin for TeaCSS. It calls the Rust engine (@teacss/engine) in process and turns virtual:teacss.css, or a CSS entry's @teacss;, into the generated CSS. It needs Bun 1.4 or later.
Install
bun add --dev @teacss/bunUse
// build.ts, run with `bun build.ts`
import { teacss } from "@teacss/bun";
await Bun.build({ entrypoints: ["./src/index.ts"], outdir: "./dist", plugins: [teacss()] });Configuration lives in a CSS entry. Create index.css at the project root:
@presets "standard,icons,official";
@source "./src/**/*.{js,jsx,ts,tsx,html}";
@teacss;Import the generated CSS once from the application entry, either as virtual:teacss.css or as the entry itself:
// src/index.ts
import "virtual:teacss.css";With outdir set, the Standard preset's fonts are written to teacss-fonts/ beside the CSS. watch(options, onBuild) reruns Bun.build when a project file changes.
Documentation
- Build integrations and their options
- The CSS entry
- The TeaCSS skill for syntax, presets and tooling
