A modern Babel preset for tooling development from the moonrepo ecosystem. Current stable version is 3.1.4, updated regularly with Babel releases. It configures the env preset for the current Node.js version, enables TypeScript, native async/await, and supports React, Solid, and JSX runtimes. Converts __DEV__/__PROD__/__TEST__ to process.env checks and wraps invariant() in conditionals. Not intended for web apps or package building — use Packemon instead. Ships TypeScript types, requires Node >=18.12.0 and @babel/core >=7.0.0.
npm install babel-preset-moonVerified import paths — ran on the pinned version, not inferred.
Shows how to install, configure babel-preset-moon with React automatic runtime, and an example usage comment.
Use Packemon (https://packemon.dev) for building packages or web applications.
Leave modules as false for ESM-friendly output; set to 'commonjs' if CJS required.
Be aware that loose mode changes semantics; test your code thoroughly.
Upgrade Node to >=18.12.0.
yarn add --dev @babel/core
yarn add --dev babel-preset-moon
Add { decorators: true } to preset options.