@teacss/rsbuild
v0.10.11
Published
Rsbuild plugin for TeaCSS: an Rspack loader that calls the Rust engine (@teacss/engine) directly
Readme
@teacss/rsbuild
The Rsbuild plugin for TeaCSS. An Rspack loader calls the Rust engine (@teacss/engine) in process and replaces the CSS entry's @teacss; with the generated CSS. It needs Node.js 26 or later and Rsbuild 1 or later.
Install
npm install --save-dev @teacss/rsbuild @rsbuild/coreUse
// rsbuild.config.ts
import { defineConfig } from "@rsbuild/core";
import { pluginTeacss } from "@teacss/rsbuild";
export default defineConfig({ plugins: [pluginTeacss()] });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 entry from a script, not through a CSS @import:
// src/index.ts
import "../index.css";The generated CSS covers the files @source matches, so it does not depend on the order Rspack builds modules in.
Documentation
- Build integrations and their options, including the Rsbuild-only
test - The CSS entry
- The TeaCSS skill for syntax, presets and tooling
