Node.js-specific utilities and runtime functionality for Tailwind CSS v4, providing compilation tools, module dependency analysis, source map handling, path normalization, and optimization utilities.
Create a helper that compiles Tailwind-oriented CSS sources into final CSS while tracking every dependency and optionally rewriting asset URLs.
@import "./fixtures/buttons.css" statement plus utility usage (for example @apply p-4 bg-white), compiling with a base directory that contains the imported file returns final CSS with those utilities expanded and records both the entry file and imported stylesheet as dependencies. @testfrom values are supplied. @testrewriteUrls is false, a rule like background-image: url("../images/icon.svg") remains unchanged; when rewriteUrls is true and a project root is supplied, the URL is rewritten relative to that root. @testroot field; when it matches, it surfaces the pattern in the result. @test@generates
export type CssSource =
| { type: "string"; css: string; from?: string }
| { type: "ast"; ast: any; from?: string };
export interface BuildOptions {
/** Base directory used for resolving @import paths and modules */
base: string;
/** Whether to rewrite relative asset URLs */
rewriteUrls?: boolean;
/** Project root to use as the rewrite target */
projectRoot?: string;
/** Optional glob describing valid source roots to surface in the result */
sourceRoot?: { pattern: string } | "none";
}
export interface BuildResult {
/** Final compiled CSS */
css: string;
/** Absolute file paths discovered during compilation */
dependencies: string[];
/** Source root match status */
root?: { pattern: string } | "none";
}
export async function buildTailwindStyles(
source: CssSource,
options: BuildOptions
): Promise<BuildResult>;Provides Tailwind-aware compilation helpers with Node-based module resolution, dependency callbacks, and optional URL rewriting.
tessl i tessl/npm-tailwindcss--node@4.1.0docs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10