Registry / ai-ml / rollup-plugin-jsx

rollup-plugin-jsx

JSON →
library1.0.3jsnpmunverified

A Rollup plugin that transforms JSX syntax into JavaScript using jsx-transform. Version 1.0.3 is the latest stable release, with no recent updates. It allows configuring JSX factory functions and pragma options. Compared to alternatives like @rollup/plugin-babel with React preset or @rollup/plugin-sucrase, it is a lightweight, zero-config option for simple JSX transformation without full Babel setup. However, it is a thin wrapper around an unmaintained library (jsx-transform) and may not support modern JSX features like automatic runtime; it is best suited for legacy projects.

npm install rollup-plugin-jsx
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-JSX
R
rollup-plugin-jsx
ai-mljavascriptv1.0.3
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
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
musl
node 18–223 runs
build_error
glibc
node 18–223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

jsx
✓ import jsx from 'rollup-plugin-jsx'
✗ const jsx = require('rollup-plugin-jsx')
ES module import; CommonJS require also works as the package has a default export.
jsx
✓ const jsx = require('rollup-plugin-jsx').default
✗ const jsx = require('rollup-plugin-jsx')
In CommonJS, the default export is accessed via .default. The module is not ESM-only.
jsx
✓ import jsx from 'rollup-plugin-jsx'; // default export
✗ import { jsx } from 'rollup-plugin-jsx'
There is no named export; use default import.

Shows how to configure rollup-plugin-jsx with a custom factory and pragma for JSX transformation in a Rollup build.

import jsx from 'rollup-plugin-jsx'; export default { input: 'src/index.js', output: { file: 'bundle.js', format: 'iife', }, plugins: [ jsx({ factory: 'React.createElement', pragma: 'h', }), ], };
Debug
Known issues
gotchaThe underlying jsx-transform library is unmaintained; may not support modern JSX features like automatic runtime (React 17+).
fix
Consider using @rollup/plugin-babel with @babel/preset-react or @rollup/plugin-sucrase for full JSX support.
affects: >=1.0.0
deprecatedThe 'pragma' option is deprecated in favor of 'factory' in some future versions. Check compatibility.
fix
Use 'factory' option instead of 'pragma'.
affects: <1.0.0
gotchaSource maps may not work correctly if the plugin is not placed correctly in the plugin array (should be before any minification).
fix
Ensure the plugin is listed before other transforms in the Rollup config.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Could not resolve 'jsx-transform'
Missing peer dependency jsx-transform
fix
Run npm install jsx-transform
TypeError: jsx is not a function
Incorrect import: using named import instead of default
fix
Use `import jsx from 'rollup-plugin-jsx'` (default import) instead of `import { jsx } from 'rollup-plugin-jsx'`
Module not found: Can't resolve 'react' in '...'
JSX output expects React to be globally available but it's not bundled
fix
Include React as a dependency, use an external globals, or use @rollup/plugin-node-resolve
Upgrade
Version history
1.0.3latest on npm
Audit
Dependencies
jsx-transformrequiredCore dependency for JSX transformation; provides the actual transform logic.
Agent activity
30 hits · last 30 days
node
24
Amazon
1
OpenAI (training)
1
Resources
rollup-plugin-jsx — npm install rollup-plugin-jsx · libregistry