{"id":19332,"library":"babel-preset-react-union","title":"babel-preset-react-union","description":"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.","status":"active","version":"0.20.0","language":"javascript","source_language":"en","source_url":"https://github.com/lundegaard/react-union","tags":["javascript"],"install":[{"cmd":"npm install babel-preset-react-union","lang":"bash","label":"npm"},{"cmd":"yarn add babel-preset-react-union","lang":"bash","label":"yarn"},{"cmd":"pnpm add babel-preset-react-union","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required for Babel transformation","package":"@babel/core","optional":false},{"reason":"Peer dependency for polyfilling modern JavaScript features","package":"core-js","optional":true}],"imports":[{"note":"CommonJS module; use require in .babelrc or babel.config.js","wrong":"import preset from 'babel-preset-react-union'","symbol":"default","correct":"module.exports = require('babel-preset-react-union')"},{"note":"In Babel config files, use the shorthand name 'react-union'","wrong":"{\n  \"presets\": [\"babel-preset-react-union\"]\n}","symbol":"default","correct":"{\n  \"presets\": [\"react-union\"]\n}"},{"note":"CommonJS export; no ESM wrapper","wrong":"import { createReactUnionPreset } from 'babel-preset-react-union'","symbol":"createReactUnionPreset","correct":"const createReactUnionPreset = require('babel-preset-react-union').createReactUnionPreset"}],"quickstart":{"code":"// babel.config.js\nmodule.exports = {\n  presets: [\n    ['react-union', {\n      targets: { browsers: '> 0.25%, not dead' },\n      useBuiltIns: 'usage',\n      corejs: 3\n    }]\n  ]\n};","lang":"javascript","description":"Configure Babel to use the react-union preset with browser targets and core-js polyfill options."},"warnings":[{"fix":"Use 'react-union' as the preset name in your Babel configuration.","message":"Preset name must be 'react-union' not 'babel-preset-react-union' in Babel config","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Install core-js@3 and set corejs: 3 in preset options.","message":"Support for core-js@2 is deprecated; use core-js@3","severity":"deprecated","affected_versions":">=0.15.0"},{"fix":"Explicitly set useBuiltIns to 'entry' if you need entry-point polyfilling.","message":"Preset option 'useBuiltIns' defaulted to 'entry' in older versions; now defaults to 'usage'","severity":"deprecated","affected_versions":">=0.12.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Change preset name to 'react-union' in your Babel configuration.","cause":"Babel config uses full package name 'babel-preset-react-union' instead of shorthand 'react-union'","error":"Error: Cannot find module 'babel-preset-react-union'"},{"fix":"Ensure browserslist queries are valid (e.g., '> 0.25%, not dead').","cause":"Invalid syntax in browserslist configuration","error":"error: \".browserslistrc\" is not a valid browserslist query"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}