Registry / web-framework / rax-babel-config

rax-babel-config

JSON →
library2.0.4jsnpmunverified

Base Babel configuration for the Rax framework (cross-platform React-like UI). Version 2.0.4 is the latest stable release. This package provides a factory function that returns a Babel config object, with options to enable JSX stylesheet transforms, JSX+ plugins, JSX-to-HTML transforms, Node target preset-env, and Regenerator runtime control. It is part of the rax-scripts monorepo. Key differentiator: designed specifically for Rax projects, encapsulating the needed presets and plugins for optimal Rax development.

npm install rax-babel-config
INSTALL
IMPORT
SIG · RAX-BABEL-CONFIG
R
rax-babel-config
web-frameworkjavascriptv2.0.4
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.

getBabelConfig
const getBabelConfig = require('rax-babel-config');
import { getBabelConfig } from 'rax-babel-config';
Package does not ship ES modules; use CommonJS require. No default export.
getBabelConfig
import getBabelConfig from 'rax-babel-config';
import { getBabelConfig } from 'rax-babel-config';
This works only if using bundler with CJS interop (e.g., Babel's module transform). In Node ESM, use createRequire.
getBabelConfig
const { getBabelConfig } = require('rax-babel-config');
Destructuring works but function is the only export.

Shows how to install and use rax-babel-config to generate a Babel config for a Rax project.

const getBabelConfig = require('rax-babel-config'); const babelConfig = getBabelConfig({ styleSheet: true, jsxPlus: false, jsxToHtml: false, isNode: false, disableRegenerator: false }); console.log(JSON.stringify(babelConfig, null, 2));
Debug
Known issues
breakingVersion 3.x of rax-scripts introduced breaking changes for postcss-loader options in rax-webpack-config and @builder/rax-pack.
fix
Update your postcss-loader configuration to match new options format; refer to changelog.
affects: >=3.8.16
deprecatedrax-babel-config is a legacy package; consider migrating to the newer @builder/rax-babel-config.
fix
Replace rax-babel-config with @builder/rax-babel-config in package.json and update imports.
affects: >=2.0.4
gotchaPackage does not export as ES module; must use require() in Node.js CommonJS. Using import may fail depending on bundler/Node version.
fix
Use require() or set up CJS interop.
affects: >=2.0.0
gotchaThe 'styleSheet' option enables a plugin that transforms JSX style objects; if not needed, disable to avoid unnecessary transforms.
fix
Set styleSheet: false in options if not using inline styles.
affects: >=2.0.0
gotchaThe 'jsxPlus' option enables JSX+ syntax (e.g., loops, conditionals). Ensure your Babel runtime supports these extensions.
fix
Install @babel/plugin-transform-react-jsx if jsxPlus is used incorrectly.
affects: >=2.0.0
Errors
Common errors & fixes
Cannot find module 'rax-babel-config'
Package not installed or not in node_modules.
fix
Run 'npm install rax-babel-config --save-dev'.
require() of ES Module not supported
Trying to require a package that is defined as type: module in package.json.
fix
Use dynamic import() or convert to CommonJS. Note: rax-babel-config itself is CJS, but if your project is ESM, use createRequire.
getBabelConfig is not a function
Incorrect import style; package exports a function directly, not a named export.
fix
Use 'const getBabelConfig = require('rax-babel-config');' as default import.
TypeError: Cannot read property 'presets' of undefined
Babel config merging issue; getBabelConfig returns an object, but it may need to be spread into a full babel config.
fix
Properly merge the returned config object with your base Babel configuration.
Upgrade
Version history
2.0.4latest on npm
Audit
Dependencies
@babel/corerequiredPeer dependency of rax-babel-config; required for compiling Babel config
Agent activity
4 hits · last 30 days
node
4
Resources
rax-babel-config — npm install rax-babel-config · libregistry