{"id":19138,"library":"babel-plugin-react-remove-classname","title":"babel-plugin-react-remove-classname","description":"A Babel plugin (v1.0.0, last updated 2018) that removes CSS class names from JSX className attributes based on a configurable prefix (default \"test-\"). Useful for stripping test-only classes in production builds. Minimal configuration, no dependencies. Works with Babel 7 (v1.x) and Babel 6 (v0.x).","status":"active","version":"1.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/akameco/babel-plugin-react-remove-classname","tags":["javascript","babel","babel-plugin","ast"],"install":[{"cmd":"npm install babel-plugin-react-remove-classname","lang":"bash","label":"npm"},{"cmd":"yarn add babel-plugin-react-remove-classname","lang":"bash","label":"yarn"},{"cmd":"pnpm add babel-plugin-react-remove-classname","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Used in .babelrc or babel.config.js as a string reference.","symbol":"default plugin","correct":"module.exports = { plugins: ['react-remove-classname'] }"},{"note":"Specify options using array syntax with the required module.","wrong":"module.exports = { plugins: ['babel-plugin-react-remove-classname'] }","symbol":"with options","correct":"const plugin = require('babel-plugin-react-remove-classname'); module.exports = { plugins: [[plugin, { prefix: 'e2e-' }]] }"},{"note":"The plugin is CommonJS only; ESM import is a default import.","wrong":"import { reactRemoveClassname } from 'babel-plugin-react-remove-classname'","symbol":"ESM import (for tools that support it)","correct":"import removeClassname from 'babel-plugin-react-remove-classname'; export default { plugins: [[removeClassname, { prefix: 'test-' }]] }"}],"quickstart":{"code":"// .babelrc\n{\n  \"plugins\": [\n    [\"react-remove-classname\", { \"prefix\": \"test-\" }]\n  ]\n}\n\n// Input: <div className=\"test-a hello test-b\"></div>\n// Output: <div className=\"hello\"></div>","lang":"javascript","description":"Configure Babel to remove class names starting with 'test-' from JSX className attributes."},"warnings":[{"fix":"Upgrade to Babel 7 and Node.js >=6, and update .babelrc to use 'react-remove-classname' (no babel-plugin- prefix) for Babel 7.","message":"v1.0.0 drops support for Node.js <6 and requires Babel 7.","severity":"breaking","affected_versions":">=0.x <1.0.0"}],"env_vars":null,"search_vec":"'2018':13 '6':51 '7':47 'ast':58 'attribut':22 'babel':2,8,46,50,54,56 'babel-plugin':55 'babel-plugin-react-remove-classnam':1 'base':23 'build':39 'class':17,36 'classnam':6,21 'configur':26,41 'css':16 'default':28 'depend':43 'javascript':53 'jsx':20 'last':11 'minim':40 'name':18 'plugin':3,9,57 'prefix':27 'product':38 'react':4 'remov':5,15 'strip':32 'test':29,34 'test-on':33 'updat':12 'use':30 'v0.x':52 'v1.0.0':10 'v1.x':48 'work':44","created_at":"2026-04-25T11:16:14.299933+00:00","updated_at":"2026-04-25T11:16:14.299933+00:00","problems":[{"fix":"Run npm install --save-dev babel-plugin-react-remove-classname","cause":"Plugin not installed or not in node_modules.","error":"Error: Cannot find module 'babel-plugin-react-remove-classname'"},{"fix":"Use array syntax: [\"react-remove-classname\", { \"prefix\": \"custom-\" }]","cause":"Incorrect configuration format in .babelrc.","error":"ReferenceError: [BABEL] unknown: Unknown option: .prefix"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/akameco/babel-plugin-react-remove-classname","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/babel-plugin-react-remove-classname","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-24","install_tag":null}}