Vite plugin (v1.3.0) that automatically adds `data-component-id` attributes to JSX/TSX components for easier debugging and tracking. Ships TypeScript types, supports Vite 5.x–8.x. Differentiated by its simplicity and focus on component-level identification, as opposed to heavier instrumentation tools. Released under a stable, infrequent cadence.
npm install lovable-taggerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows minimal Vite config to enable component tagging with default options.
Update import and usage: replace `new ComponentTagger(options)` with `componentTagger(options)`.
Replace `ignorePatterns: ['**/node_modules/**']` with `exclude: ['**/node_modules/**']`.
Use `componentTagger({ dev: true })` to enable tagging during development.Upgrade Vite to v5 or higher. If sticking with Vite 4, lock to lovable-tagger@1.2.x.
Use `include` option to add extra paths, e.g., `componentTagger({ include: ['src/**', 'packages/**'] })`.Change import to `import { componentTagger } from 'lovable-tagger'`.Call as `componentTagger()` without `new`, or destructure CJS require: `const { componentTagger } = require('lovable-tagger')`.Upgrade Vite to v5+ or downgrade lovable-tagger to 1.2.x.
Rename the option to `exclude` in the plugin config.