Launched January 3, 2023

Vite Plugin - React.js Remove Attributes
Vite Plugin - React.js Remove Attributes
Free8,839 impressions#120 of its week
Simplify your production code and enhance performance with this unique Vite plugin designed specifically for React.js projects. The plugin seamlessly removes specified attributes from your tsx/jsx HTML codes during production builds, ensuring a clutter-free and optimized application.
A Vite plugin that removes specified attributes from React JSX/TSX files during production builds.
- for
- React developers using Vite who want cleaner production bundles
- pricing
- free
- license
- GPL-3.0
works withViteReact
Key features
4 features of Vite Plugin - React.js Remove Attributes
- Selective Attribute Removal — Choose which attributes (e.g., data-testid) to strip from the output code.
- File Extension Specificity — Configure the plugin to process only .tsx and .jsx files.
- Granular Exclusions — Exclude specific folders or files from attribute removal.
- Clean Production Code — Reduces bundle size and improves performance by removing unnecessary attributes.
Use cases
- Remove testing attributes like data-testid from production builds
- Exclude test folders from attribute stripping
- Optimize bundle size by stripping custom HTML attributes
Vite Plugin - React.js Remove Attributes FAQ
How do I install the plugin?+
Run npm install --save-dev react-remove-attr in your Vite project.
How do I configure which attributes to remove?+
Pass an attributes array in the plugin options, e.g., attributes:['data-testid','data-timestamp'].
Can I limit the plugin to certain file types?+
Yes, use the extensions option to specify ['jsx','tsx'] or other extensions.
How do I exclude specific folders or files?+
Provide ignoreFolders and ignoreFiles arrays in the plugin configuration.
Do I need any other plugins for it to work?+
The plugin works alongside @vitejs/plugin-react; include both in the plugins array.
Summarized by DevHunt from npmjs.com · Sep 28, 2026. Details may change; check the official site.










