vite_plugin_fuz_css.ts view source
"/* generated by vite_plugin_fuz_css */" Marker comment used to delimit generated CSS in the output.
Vite plugin for fuz_css utility class generation.
Uses Vite's transform hook to extract CSS classes from source files as they're processed, including node_modules dependencies. Generates CSS on-demand via virtual module with HMR support.
@example ```ts // vite.config.ts import {defineConfig} from 'vite'; import jsx from 'acorn-jsx'; import {vite_plugin_fuz_css} from '@fuzdev/fuz_css/vite_plugin_fuz_css.js';
export default defineConfig({ plugins: [ vite_plugin_fuz_css({ acorn_plugins: [jsx()], }), ], }); ```
3 declarations
vite_plugin_fuz_css.ts view source
"/* generated by vite_plugin_fuz_css */" Marker comment used to delimit generated CSS in the output.
vite_plugin_fuz_css.ts view source
(options?: VitePluginFuzCssOptions): Plugin$1<any> Creates the fuz_css Vite plugin.
Extracts CSS classes from source files during Vite's transform phase
and generates optimized CSS via the virtual:fuz.css virtual module.
options{}Plugin$1<any> vite_plugin_fuz_css.ts view source
VitePluginFuzCssOptions Options for the fuz_css Vite plugin.
filter_fileFilter function to determine which files to extract classes from. By default, extracts from .svelte, .html, .ts, .js, .tsx, .jsx files, excluding test files and .gen files.
class_definitionsAdditional class definitions to merge with defaults.
User definitions take precedence over defaults with the same name.
Required when include_default_definitions is false.
Record<string, CssClassDefinition | undefined>include_default_definitionsWhether to include default class definitions (token and composite classes).
When false, class_definitions is required.
booleanclass_interpretersCustom interpreters for dynamic class generation. Replaces the builtin interpreters entirely if provided.
Array<CssClassDefinitionInterpreter>include_classesClasses to always include in the output, regardless of detection.
Iterable<string>exclude_classesClasses to exclude from the output, even if detected.
Iterable<string>acorn_pluginsAdditional acorn plugins for parsing.
Use acorn-jsx for React/Preact/Solid projects.
Array<AcornPlugin>on_errorHow to handle CSS-literal errors during generation. - 'log': Log errors, skip invalid classes, continue - 'throw': Throw on first error, fail the build
'log' | 'throw'on_warningHow to handle warnings during generation. - 'log': Log warnings, continue - 'throw': Throw on first warning, fail the build - 'ignore': Suppress warnings entirely
'log' | 'throw' | 'ignore'cache_dirCache directory relative to project root.
string