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 · Dec 6, 2026

rollup-plugin-jsx-remove-attributes has 37,122 recorded weekly downloads on npm, an increase of 133% over the past 30 days, ranking #868 of 3,247 tracked listings.

Weekly downloads
37,122
Official API · Dec 5, 2026
7-day growth
-11.5%
-4.8K weekly downloads
30-day growth
+133%
+21.2K weekly downloads
90-day growth
-51.6%
-39.7K weekly downloads
Rank
#868
▼ 64 in 7 days

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: 37,122 weekly downloads as of Dec 5, 2026, -51.6% over 90 days.rollup-plugin-jsx-remove-attributesWeekly downloads on npm · Last 90 days37,122downloads / week-51.6% over 90 days020K40K60K80K100KSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
rollup-plugin-jsx-remove-attributes weekly downloads on npm, last 90 days: 37,122 weekly downloads as of Dec 5, 2026, -51.6% over 90 days.

7/30/90-day growth

rollup-plugin-jsx-remove-attributes weekly downloads growth on npm: -11.5% over 7 days, +133% over 30 days, -51.6% over 90 days.rollup-plugin-jsx-remove-attributesWeekly downloads growth on npm37,122downloads / week now7-day growth-4,802 weekly downloads-11.5%30-day growth+21,177 weekly downloads+133%90-day growth-39,650 weekly downloads-51.6%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
rollup-plugin-jsx-remove-attributes weekly downloads growth on npm: -11.5% over 7 days, +133% over 30 days, -51.6% over 90 days.

Ranking history

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

Listing placement

All npm3,247 listings · 163 pages · 1,083 shown · page 44, #8 (overall #868)
All npm: every listing in weekly downloads order

Listing placement

Vite plugins300 listings · 15 pages · page 8, #12 (overall #152)
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 (592)
Recent weekly downloads observations for rollup-plugin-jsx-remove-attributes
Date (UTC)Weekly downloadsChange vs. previous
37,122-1.1K
38,249-3.7K
41,916-1.3K
43,168-1.1K
44,284-1K
45,305+3.5K
41,778-146
41,924+1.3K
40,622+7.9K
32,687+5.9K
26,811+4.5K
22,318+3.9K
18,388+201
18,187—

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 Dec 6, 2026. See the methodology.