component-tagger
Version:
A Vite plugin that automatically adds comprehensive component tagging attributes to JSX/TSX elements for debugging and testing
43 lines (42 loc) • 943 B
TypeScript
import { Plugin } from 'vite';
interface ComponentTaggerOptions {
/**
* Include component ID (file:line:column)
* @default true
*/
includeId?: boolean;
/**
* Include component name
* @default false
*/
includeName?: boolean;
/**
* Include component path
* @default true
*/
includePath?: boolean;
/**
* Include line number
* @default true
*/
includeLine?: boolean;
/**
* Include filename
* @default true
*/
includeFile?: boolean;
/**
* Include component content/props
* @default false
*/
includeContent?: boolean;
/**
* Only add attributes in development mode
* @default true
*/
developmentOnly?: boolean;
}
declare function componentTagger(options?: ComponentTaggerOptions): Plugin;
export { componentTagger };
export type { ComponentTaggerOptions };
export default componentTagger;