{"library":"rollup-plugin-jsx-remove-attributes","title":"rollup-plugin-jsx-remove-attributes","description":"A Rollup and Vite plugin to remove specified JSX attributes (e.g., data-testid) from production builds, reducing bundle size. Current version 3.1.2, requires Node >=20.8.0. Supports Rollup and Vite, with Preact support added in v3.1.0. Key differentiator: simple configuration for stripping test-only attributes without Babel plugin overhead. Active development, peer deps include @rollup/pluginutils, astring, estree-walker, and Vite >=5.2. Ships TypeScript types.","language":"javascript","status":"active","last_verified":"Mon Apr 27","install":{"commands":["npm install rollup-plugin-jsx-remove-attributes"],"cli":null},"imports":["import removeTestIdAttribute from 'rollup-plugin-jsx-remove-attributes'","const removeTestIdAttribute = require('rollup-plugin-jsx-remove-attributes')","import type { PluginOptions } from 'rollup-plugin-jsx-remove-attributes'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { defineConfig } from 'vite';\nimport react from '@vitejs/plugin-react';\nimport removeTestIdAttribute from 'rollup-plugin-jsx-remove-attributes';\n\nexport default defineConfig({\n  plugins: [\n    react(),\n    removeTestIdAttribute({\n      include: [/\\.tsx$/],\n      exclude: ['node_modules/**'],\n      attributes: ['data-testid', 'data-cy'],\n      environments: ['production', 'staging'],\n      usage: 'vite'\n    })\n  ]\n});","lang":"typescript","description":"Configures Vite to remove 'data-testid' and 'data-cy' attributes from JSX in production builds.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}