A Babel plugin that compiles JSX into tagged template literals compatible with the htm library. Current stable version is 2.2.0. This plugin enables developers to use JSX syntax without a full Virtual DOM library or React, producing lightweight template literals instead of React.createElement calls. It supports custom tag functions, automatic imports of the htm tag, and namespaced JSX elements. Compared to similar tools like babel-plugin-jsx-to-html, this plugin specifically targets htm's syntax and ecosystem, offering tight integration with Preact and other htm-based libraries. Release cadence is irregular; last major feature release was v2.2.0 in 2020. Not actively maintained, but functional for existing projects.
npm install babel-plugin-transform-jsx-to-htmNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Babel config to compile JSX into htm tagged templates with automatic import of the html tag from htm/preact.
Consider migrating to babel-plugin-htm (if available) or using htm directly with JSX pragma.
Use [['babel-plugin-transform-jsx-to-htm', { ... }]] instead of ['babel-plugin-transform-jsx-to-htm', { ... }].Run 'npm install htm' if you use the import option.
Update to v2.2.0+ or avoid namespaced JSX.
npm install --save-dev babel-plugin-transform-jsx-to-htm
Use [['babel-plugin-transform-jsx-to-htm', { tag: 'html' }]] instead of ['babel-plugin-transform-jsx-to-htm', { tag: 'html' }].Set import option correctly or ensure tag matches your import. Example: { import: { module: 'htm/preact', export: 'html' } }.No dependency data recorded yet.
No traffic data recorded yet.