@teacss/rsbuild
v0.4.1
Published
Rsbuild integration for TeaCSS — generate utilities and optimize with lightningcss, no PostCSS.
Downloads
1,418
Readme
@teacss/rsbuild
Rsbuild integration for TeaCSS.
Purpose
The plugin replaces @teacss in the configured CSS entry with generated
utilities and can optimize the result with lightningcss.
Use this package in Rsbuild applications that want TeaCSS generation, dependency tracking, directive transforms, and CSS optimization in the Rsbuild lifecycle. It is a native Rsbuild plugin and does not require the PostCSS integration; non-Rsbuild projects should choose the adapter for their own build tool.
Usage
import { defineConfig } from "@rsbuild/core";
import { pluginTeacss } from "@teacss/rsbuild";
export default defineConfig({
plugins: [pluginTeacss()],
});@preset "standard";
@source "./src/**/*.{ts,tsx}";
@teacss;Positive @source globs register their stable base directories as Rsbuild
context dependencies. New files matching an include therefore trigger a
rebuild; negative source patterns are not registered as watch roots.
Default source discovery skips dependency and common build-output directories,
while explicit @source globs can include them.
When directive transforms are enabled, their default CSS matcher is combined
with a custom entry test, so configured non-.css entries such as .pcss
still reach TeaCSS.
Low-level helpers such as generate, transformCss, and optimize are
exported for integration tests and advanced tooling.
Status
Pre-1.0. @teacss/rsbuild is the owning Rsbuild adapter. Applications install
it beside the teacss runtime and import it directly from @teacss/rsbuild.
