Sign In

steercode-tagger

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

steercode-tagger

Vite plugin for component tagging and tracking

latest
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

SteerCode Component Tagger

A Vite plugin that automatically adds data attributes to JSX/TSX components for easier debugging, tracking, and analytics.

Installation

npm install steercode-tagger

Usage

Add the plugin to your Vite configuration:

// vite.config.js or vite.config.ts
import { defineConfig } from 'vite';
import { componentTagger } from 'steercode-tagger';

export default defineConfig({
  plugins: [
    componentTagger(),
    // ... other plugins
  ],
});

What It Does

This plugin automatically adds data attributes to your JSX/TSX components:

  • data-steer-id: A unique identifier for each component
  • data-steer-name: The name of the component
  • data-component-path: File path (for legacy compatibility)
  • data-component-line: Line number (for legacy compatibility)
  • data-component-file: File name (for legacy compatibility)
  • data-component-name: Component name (for legacy compatibility)
  • data-component-content: Content information (for legacy compatibility)

These attributes make it easier to:

  • Track component usage in analytics
  • Debug components in development
  • Identify components in the DOM
  • Connect components to their source code

Configuration

The plugin works out of the box with no configuration needed. It automatically detects JSX/TSX files and adds the appropriate attributes.

License

MIT

Keywords

vite

FAQs

Package last updated on 26 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts