Registry / babel-plugin-jsxfileattribute
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.
babelPluginJsxFileAttribute
✓ const babelPluginJsxFileAttribute = require('babel-plugin-jsxfileattribute');
✗ import babelPluginJsxFileAttribute from 'babel-plugin-jsxfileattribute';
This package does not export ESM; use CommonJS require. No default export name is documented.
default (ESM alternative)
✓ import pkg from 'babel-plugin-jsxfileattribute'; const babelPluginJsxFileAttribute = pkg.default || pkg;
✗ import { babelPluginJsxFileAttribute } from 'babel-plugin-jsxfileattribute';
Named import is not supported. Use default import and possibly access .default.
plugin usage in babel.config.js
✓ plugins: [[ require('babel-plugin-jsxfileattribute'), { options } ]]
✗ plugins: ['babel-plugin-jsxfileattribute']
Must call require() to get the function, not pass string. Options object is optional.
This shows how to configure the plugin for development, enabling file attribute injection with options.
// babel.config.js
module.exports = {
plugins: [
process.env.NODE_ENV === 'development' && [
require('babel-plugin-jsxfileattribute'),
{
userSetPwd: '/path/to/cut',
isShowAwakeIdeMsg: true,
onlyShowAwakeIdeMsg: true,
showCompleteFilePath: false,
exclude: ["Fragment", "React.Fragment"]
}
]
].filter(Boolean)
};
Errors
Common errors & fixes
Module not found: Error: Can't resolve 'babel-plugin-jsxfileattribute'
Package not installed or typo in package name.
fixRun npm install babel-plugin-jsxfileattribute --save-dev
TypeError: babelPluginJsxFileAttribute is not a function
Using import { babelPluginJsxFileAttribute } ... instead of default import/require.
fixChange to const babelPluginJsxFileAttribute = require('babel-plugin-jsxfileattribute'); Uncaught Error: @babel/core is required as a peer dependency
@babel/core is missing or version incompatible.
fixInstall @babel/core: npm install @babel/core --save-dev
Audit
Dependencies
@babel/corerequiredpeer dependency required for Babel plugin system