Registry / web-framework / babel-preset-react-union

babel-preset-react-union

JSON →
library0.20.0jsnpmunverified

Babel preset for React Union, version 0.20.0. It provides a shared Babel configuration used in Lundegaard projects to streamline React integration into legacy systems. The preset includes necessary plugins and presets for modern JavaScript and React transformations. Release cadence is low; it's part of the react-union monorepo. Key differentiators: tailored for micro-frontends and gradual adoption in legacy codebases, with support for dynamic loading and shared dependencies.

npm install babel-preset-react-union
INSTALL
IMPORT
SIG · BABEL-PRESET-REACT
B
babel-preset-react-union
web-frameworkjavascriptv0.20.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 = require('babel-preset-react-union')
import preset from 'babel-preset-react-union'
CommonJS module; use require in .babelrc or babel.config.js
default
{ "presets": ["react-union"] }
{ "presets": ["babel-preset-react-union"] }
In Babel config files, use the shorthand name 'react-union'
createReactUnionPreset
const createReactUnionPreset = require('babel-preset-react-union').createReactUnionPreset
import { createReactUnionPreset } from 'babel-preset-react-union'
CommonJS export; no ESM wrapper

Configure Babel to use the react-union preset with browser targets and core-js polyfill options.

// babel.config.js module.exports = { presets: [ ['react-union', { targets: { browsers: '> 0.25%, not dead' }, useBuiltIns: 'usage', corejs: 3 }] ] };
Debug
Known issues
gotchaPreset name must be 'react-union' not 'babel-preset-react-union' in Babel config
fix
Use 'react-union' as the preset name in your Babel configuration.
affects: >=0.1.0
deprecatedSupport for core-js@2 is deprecated; use core-js@3
fix
Install core-js@3 and set corejs: 3 in preset options.
affects: >=0.15.0
deprecatedPreset option 'useBuiltIns' defaulted to 'entry' in older versions; now defaults to 'usage'
fix
Explicitly set useBuiltIns to 'entry' if you need entry-point polyfilling.
affects: >=0.12.0
Errors
Common errors & fixes
Error: Cannot find module 'babel-preset-react-union'
Babel config uses full package name 'babel-preset-react-union' instead of shorthand 'react-union'
fix
Change preset name to 'react-union' in your Babel configuration.
error: ".browserslistrc" is not a valid browserslist query
Invalid syntax in browserslist configuration
fix
Ensure browserslist queries are valid (e.g., '> 0.25%, not dead').
Upgrade
Version history
0.20.0latest on npm
Audit
Dependencies
@babel/corerequiredPeer dependency required for Babel transformation
core-jsoptionalPeer dependency for polyfilling modern JavaScript features
Agent activity
10 hits · last 30 days
node
8
OpenAI (training)
1
Resources
babel-preset-react-union — npm install babel-preset-react-union · libregistry