ghostmark
Version:
A powerful Vite plugin that invisibly marks JSX elements with debug attributes for seamless development and testing
69 lines (68 loc) • 1.51 kB
TypeScript
import { Plugin } from 'vite';
interface GhostmarkOptions {
/**
* Include component ID (file:line:column)
* @default true
*/
includeId?: boolean;
/**
* Include component name
* @default false
*/
includeName?: boolean;
/**
* Include component path
* @default false
*/
includePath?: boolean;
/**
* Include line number
* @default false
*/
includeLine?: boolean;
/**
* Include filename
* @default false
*/
includeFile?: boolean;
/**
* Include component content/props
* @default false
*/
includeContent?: boolean;
/**
* Custom tag prefix for data attributes
* @default "gm"
* @example "myapp" will generate data-myapp-id, data-myapp-path, etc.
*/
tagPrefix?: string;
/**
* File extensions to process
* @default ['.jsx', '.tsx']
*/
include?: string[];
/**
* Paths to exclude from processing
* @default ['node_modules']
*/
exclude?: string[];
/**
* Use relative paths in debug info
* @default true
*/
useRelativePath?: boolean;
/**
* Enable debug logging
* @default false
*/
debug?: boolean;
/**
* Filter out Three.js and Drei 3D elements
* @default true
*/
filter3DElements?: boolean;
}
declare const ghostmark: (options?: GhostmarkOptions) => Plugin;
export { ghostmark };
export type { GhostmarkOptions };
export default ghostmark;