UNPKG

@lucidlayer/babel-plugin-traceform

Version:

Babel plugin to inject data-traceform-id attributes into React components for Traceform

21 lines (20 loc) 801 B
import { PluginObj, PluginPass } from '@babel/core'; /** * Root determination modes supported by the plugin * - 'auto': Try package.json first, then git, then monorepo markers * - 'package': Use nearest package.json directory * - 'git': Use nearest .git directory * - 'monorepo': Use nearest monorepo marker (pnpm-workspace.yaml, lerna.json, etc) * - 'custom': Use the customRoot path provided * - 'none': Don't normalize paths at all, use absolute paths */ type RootMode = 'auto' | 'package' | 'git' | 'monorepo' | 'custom' | 'none'; export default function injectComponentIdPlugin(options?: { instrumentAllElements?: boolean; quiet?: boolean; logIds?: boolean; rootMode?: RootMode; customRoot?: string; includeAbsPath?: boolean; }): PluginObj<PluginPass>; export {};