babel-preset-react-optimised

JSON →
library 1.0.0 ·javascript
verified Jun 4, 2026

A Babel preset that replaces React.createElement and React.createFragment with shorter local variable aliases (__jsx, __jsxFrag) to reduce minified bundle size. Current stable version is 1.0.0. This preset is a drop-in replacement for @babel/preset-react, offering a ~10% size reduction on typical React components. It is designed for production builds where every byte counts, but note that it reserves the variable names __jsx and __jsxFrag. The preset relies on @babel/core as a peer dependency and has no other dependencies. It is compatible with React JSX transforms and can be customized via pragma and pragmaFrag options.