Registry /
devops / babel-plugin-react-remove-classname
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
default plugin
✓ module.exports = { plugins: ['react-remove-classname'] }
Used in .babelrc or babel.config.js as a string reference.
with options
✓ const plugin = require('babel-plugin-react-remove-classname'); module.exports = { plugins: [[plugin, { prefix: 'e2e-' }]] }
✗ module.exports = { plugins: ['babel-plugin-react-remove-classname'] }
Specify options using array syntax with the required module.
ESM import (for tools that support it)
✓ import removeClassname from 'babel-plugin-react-remove-classname'; export default { plugins: [[removeClassname, { prefix: 'test-' }]] }
✗ import { reactRemoveClassname } from 'babel-plugin-react-remove-classname'
The plugin is CommonJS only; ESM import is a default import.
Configure Babel to remove class names starting with 'test-' from JSX className attributes.
// .babelrc
{
"plugins": [
["react-remove-classname", { "prefix": "test-" }]
]
}
// Input: <div className="test-a hello test-b"></div>
// Output: <div className="hello"></div>
Errors
Common errors & fixes
Error: Cannot find module 'babel-plugin-react-remove-classname'
Plugin not installed or not in node_modules.
fixRun npm install --save-dev babel-plugin-react-remove-classname
ReferenceError: [BABEL] unknown: Unknown option: .prefix
Incorrect configuration format in .babelrc.
fixUse array syntax: ["react-remove-classname", { "prefix": "custom-" }] Audit
Dependencies
No dependency data recorded yet.