Registry / web-framework / babel-preset-cx-env

babel-preset-cx-env

JSON →
library26.1.0jsnpmunverified

A Babel preset for compiling CxJS applications, version 26.1.0. Integrates @babel/proposal-class-properties, @babel/proposal-function-bind, @babel/transform-react-jsx, babel-plugin-transform-cx-jsx, and babel-plugin-transform-cx-imports. Released as part of CxJS tooling, updated alongside framework versions. Unlike generic React presets, it specifically transforms CxJS JSX and imports. Peer dependencies include @babel/core and @babel/preset-env.

npm install babel-preset-cx-env
INSTALL
IMPORT
SIG · BABEL-PRESET-CX-EN
B
babel-preset-cx-env
web-frameworkjavascriptv26.1.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
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 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

default
module.exports = { presets: [['babel-preset-cx-env', options]] }
import babelPresetCxEnv from 'babel-preset-cx-env'
Used in babel.config.js (CommonJS). ESM not supported in Babel config files.
preset
presets: [['babel-preset-cx-env', { cx: { jsx: { trimWhitespace: false } } }]]
presets: ['babel-preset-cx-env']
Options object is second element of array; omitting options is allowed but loses customization.

Shows configuration of babel-preset-cx-env with options for JSX whitespace and import source.

// babel.config.js module.exports = { presets: [ ['babel-preset-cx-env', { cx: { jsx: { trimWhitespace: false }, imports: { useSrc: true } } }] ] };
Debug
Known issues
gotchaOptions object must be nested inside an array as second element, not directly as presets value.
fix
Use presets: [['babel-preset-cx-env', { cx: {...} }]]
affects: >=1.0.0
deprecatedbabel-plugin-transform-cx-imports may be deprecated in future versions; use babel-plugin-cx-imports instead.
fix
Monitor changelog, consider migration to babel-plugin-cx-imports if announced.
affects: >=26.0.0
Errors
Common errors & fixes
Error: Plugin/Preset files are not allowed to export objects, only functions.
Using ES6 import in babel.config.js instead of CommonJS require.
fix
Use module.exports = { presets: [['babel-preset-cx-env', options]] }
Error: Preset babel-preset-cx-env is not installed.
Missing peer dependency @babel/preset-env or @babel/core.
fix
npm install @babel/core @babel/preset-env --save-dev
Upgrade
Version history
26.1.0latest on npm
Audit
Dependencies
@babel/corerequiredRequired peer dependency for Babel
@babel/preset-envrequiredRequired peer dependency for environment support
Agent activity
14 hits · last 30 days
node
12
OpenAI (training)
1
Resources
babel-preset-cx-env — npm install babel-preset-cx-env · libregistry