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.
Design a small utility that resolves both JavaScript/TypeScript modules and CSS stylesheets from a project base directory using alias-aware resolution. The utility should surface resolved absolute paths, loaded contents, and dependency notifications so that build systems can track what was used.
@theme/) to an absolute module path under the mapped directory relative to base, loads the module exports, and returns them with the resolved path. @testbase, loads the stylesheet contents, and returns them with the resolved path. @testonDependency callback exactly once with the resolved absolute path, regardless of whether it came from an alias match or the fallback resolver. @test@generates
export interface AliasMap {
[aliasPrefix: string]: string;
}
export interface ResolveOptions {
/** Base directory for resolution (e.g., project root) */
base: string;
/** Map of alias prefixes (like "@theme/") to directories relative to base */
aliases: AliasMap;
/** Optional callback fired once per resolved path */
onDependency?: (path: string) => void;
}
export interface ResolvedModule<T = any> {
path: string;
exports: T;
}
/** Resolve a module specifier using alias and fallback resolution, returning exports and path */
export function loadModuleWithAliases<T = any>(specifier: string, options: ResolveOptions): Promise<ResolvedModule<T>>;
/** Resolve a stylesheet specifier using alias and fallback resolution, returning contents and path */
export function loadStylesheetWithAliases(specifier: string, options: ResolveOptions): Promise<{ path: string; css: string }>;Provides Node-aware module and stylesheet resolution with customizable resolvers and dependency tracking callbacks.
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