Skip to content
PluginStats

rollup-plugin-jsx-remove-attributes weekly downloads statistics

By jacobbogers · npm · Vite plugins

rollup & vite plugin to remove jsx attributes

View on npm Fresh · Oct 18, 2026

rollup-plugin-jsx-remove-attributes has 4,263 recorded weekly downloads on npm, a decrease of 94.5% over the past 30 days, ranking #1174 of 2,322 tracked listings.

Weekly downloads
4,263
Official API · Oct 18, 2026
7-day growth
-63.9%
-7.6K weekly downloads
30-day growth
-94.5%
-73.1K weekly downloads
90-day growth
-92.5%
-52.9K weekly downloads
Rank
#1174
Among tracked npm listings

About rollup-plugin-jsx-remove-attributes

rollup(& vite)-plugin-jsx-remove-attributes

rollup & vite plugin to remove jsx attributes

This plugin can be used in vite or rollup.

The initial motivation was to remove data-testid attributes from jsx (react, etc) components.

It can be generally used to remove any number of attributes.

The plugin only runs when NODE_ENV matches the values of the environments option (default is ['production']).

Table of contents

<!-- vscode-markdown-toc -->
  1. Installation
  2. Usage with Vite
  3. Usage with Rollup
  4. Options Object
  5. Usage with Preact
  6. Usage with Babel
<!-- vscode-markdown-toc-config numbering=true autoSave=true /vscode-markdown-toc-config --> <!-- /vscode-markdown-toc -->

1. <a name='Installation'></a>Installation


npm i -D rollup-plugin-jsx-remove-attributes

2. <a name='UsagewithVite'></a>Usage with Vite

Example:

import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';

import removeTestIdAttribute from 'rollup-plugin-jsx-remove-attributes';

export default defineConfig({
    build: { sourcemap: true },
    plugins: [
        react(),
        removeTestIdAttribute({
            include: [/\.[tj]sx$/], //default
            exclude: ['**/node_modules/**'], // default
            attributes: ['data-testid'], // default, array of attribute names to strip from jsx
            environments: ['production', 'pre-prod', 'prod', 'q&a'], // default = ["production"]
            debug: false, // is the default, if "true" show more logging of the internal workings of this plugin, for troubleshooting configs
            usage: 'vite' // Must specify for vite use, default usage is rollup
        })
        // other plugins
    ]
});

3. <a name='UsagewithRollup'></a>Usage with Rollup

Example:

import { rollup } from 'rollup';
import removeTestIdAttribute from 'rollup-plugin-jsx-remove-attributes';

// see below for details on these options
const inputOptions = {
    ...
    plugins:[
      removeTestIdAttribute({
            include: [/\.[tj]sx$/], //default
            exclude: ['**/node_modules/**'], // default
            attributes: ['data-testid'],  // default, array of attribute names to strip from jsx
            environments: ['production', 'pre-prod', 'prod', 'q&a'], // default = ["production"]
            debug: false, // is the default, if "true" show more logging of the internal workings of this plugin, for troubleshooting configs
            usage: 'rollup'  // default,  when configuring for rollup "usage" can be omitted, shown for clarity only
        }),
    ]
};

const outputOptions = {...};

const bundle = await rollup.build(inputOptions);

await rollup.write(outputOptions);

4. <a name='OptionsObject'></a>Options Object

  • usage: default rollup, possible values are vite or rollup,
  • include: default[/\.[tj]sx$/], will allow anything that matches the array of glob/regexp pattern, default[/\.[tj]sx$/]
  • exclude: default ['**/node_modules/**'], will exclude anything matching the array of glob/regexp patterns
  • attributes: (optional default = [data-testid] ) array of jsx attributes to be stripped if found
  • environments: array of strings representing values of NODE_ENV for wich this plugin will run.
  • debug: default false, show more logging of internal workings of the plugin, default false

5. <a name='UsagewithPreact'></a>Usage with Preact

Preact is now supported since version 3.1.0

Please take care the insert this plugin before any minification/uglify plugin.

For example:

// imports removed for brevity
//
// https://vitejs.dev/config/
export default defineConfig({
    plugins: [
        esbuild(),
        jsxRemoveAttributes(), // <-- this plugin
        minify()
    ],
    //
    // other config info removed for brevity
});

For more information see issue

6. <a name='UsagewithBabel'></a>Usage with Babel

Since version 3.1.2 supporting runtime injections of @babel/plugin-transform-react-jsx. (this PR).

Description from the npm listing.

  • vite-plugin
  • rollup-plugin
  • data-testid
  • remove attribute

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

rollup-plugin-jsx-remove-attributes weekly downloads on npm, last 90 days: 4,263 weekly downloads as of Oct 18, 2026, -92.5% over 90 days.rollup-plugin-jsx-remove-attributesWeekly downloads on npm · Last 90 days4,263downloads / week-92.5% over 90 days020K40K60K80K100K120K140K160KJul 20Aug 4Aug 19Sep 3Sep 18Oct 3Oct 18downloads / weekobservedarchived (Internet Archive)no observationsJul 22, 2026 – Oct 18, 2026 · 89 observations · Updated Oc…pluginstats.com
rollup-plugin-jsx-remove-attributes weekly downloads on npm, last 90 days: 4,263 weekly downloads as of Oct 18, 2026, -92.5% over 90 days.

7/30/90-day growth

rollup-plugin-jsx-remove-attributes weekly downloads growth on npm: -63.9% over 7 days, -94.5% over 30 days, -92.5% over 90 days.rollup-plugin-jsx-remove-attributesWeekly downloads growth on npm4,263downloads / week now7-day growth-7,562 weekly downloads-63.9%30-day growth-73,066 weekly downloads-94.5%90-day growth-52,872 weekly downloads-92.5%Growth vs. nearest observation to each baseline date · Updated Oct 18, 2026pluginstats.com
rollup-plugin-jsx-remove-attributes weekly downloads growth on npm: -63.9% over 7 days, -94.5% over 30 days, -92.5% over 90 days.

Ranking history

rollup-plugin-jsx-remove-attributes npm ranking history: currently #1174 (by weekly downloads).rollup-plugin-jsx-remove-attributesnpm ranking · by weekly downloads · Last 90 days#1174current rank#400#600#800#1000#1200Jul 22Aug 6Aug 21Sep 5Sep 20Oct 5Oct 20rankOct 17, 2026 – Oct 20, 2026 · 4 observations · Updated Oct 18, 2026pluginstats.com
rollup-plugin-jsx-remove-attributes npm ranking history: currently #1174 (by weekly downloads).

Listing placement

All npm2,320 listings · 116 pages · 1,161 shown · page 59, #17 (overall #1,177)
All npm: every listing in weekly downloads order

Listing placement

Vite plugins253 listings · 13 pages · page 11, #13 (overall #213)
Vite plugins: every listing in weekly downloads order

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

Recent observations

Full history (544)
Recent weekly downloads observations for rollup-plugin-jsx-remove-attributes
Date (UTC)Weekly downloadsChange vs. previous
4,263+751
3,512-521
4,033+98
3,935-2.2K
6,164-4.2K
10,3450
10,345-1.5K
11,825+94
11,731-185
11,916-1K
12,917-1.1K
13,969+821
13,148-8.7K
21,868—

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/rollup-plugin-jsx-remove-attributes. First seen Oct 16, 2026; last successful collection Oct 20, 2026. See the methodology.