{"id":19320,"library":"babel-preset-o","title":"babel-preset-o","description":"A tiny and flexible Babel preset for React development, combining @babel/preset-env and @babel/preset-react with sensible defaults. Version 0.4.3 is the latest stable release; the package is actively maintained but has limited community adoption. It simplifies configuration by wrapping two commonly used presets into one, supporting custom options for targets, modules, useBuiltIns, and runtime mode (classic or automatic). Compared to alternatives like babel-preset-react-app, this preset is more lightweight and configurable, suitable for projects that need a minimal Babel setup without opinionated defaults.","status":"active","version":"0.4.3","language":"javascript","source_language":"en","source_url":"git@github.com:huozhi/babel-preset-o","tags":["javascript"],"install":[{"cmd":"npm install babel-preset-o","lang":"bash","label":"npm"},{"cmd":"yarn add babel-preset-o","lang":"bash","label":"yarn"},{"cmd":"pnpm add babel-preset-o","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"core dependency for environment-based transpilation","package":"@babel/preset-env","optional":false},{"reason":"core dependency for React JSX and other transforms","package":"@babel/preset-react","optional":false}],"imports":[{"note":"Use string reference in presets array; requiring is unnecessary but might work if preset is a module.","wrong":"module.exports = { presets: [require('babel-preset-o')] }","symbol":"babel-preset-o","correct":"module.exports = { presets: ['babel-preset-o'] }"},{"note":"Options are passed as second element in an array within presets.","symbol":"babel-preset-o with options","correct":"module.exports = { presets: [['babel-preset-o', { targets: {}, modules: 'commonjs' }]] }"},{"note":"When passing options, wrap the preset name and options in a sub-array.","wrong":"module.exports = { presets: ['babel-preset-o', { runtime: 'automatic' }] }","symbol":"customize runtime","correct":"module.exports = { presets: [['babel-preset-o', { runtime: 'automatic' }]] }"}],"quickstart":{"code":"// Install: npm i -D babel-preset-o\n// babel.config.js\nmodule.exports = {\n  presets: [\n    ['babel-preset-o', { \n      targets: { browsers: ['> 1%', 'last 2 versions'] },\n      modules: false,\n      useBuiltIns: false,\n      runtime: 'classic' \n    }]\n  ]\n}","lang":"javascript","description":"Shows how to install and configure babel-preset-o with custom targets and options for React development."},"warnings":[{"fix":"Use ['babel-preset-o', { ... }] in the presets array.","message":"Preset options must be passed in an array format: ['babel-preset-o', options]. Omitting the array or misplacing options will silently ignore them.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Set runtime: 'automatic' in preset options if using React 17+ and the new JSX transform.","message":"The 'runtime' option defaults to 'classic', which uses React.createElement. If using React 17+ JSX transform, set runtime: 'automatic' to avoid unused React imports.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Consider removing useBuiltIns and installing core-js directly for polyfills.","message":"The 'useBuiltIns' option is deprecated in Babel 7.4+; prefer using @babel/polyfill or core-js directly.","severity":"deprecated","affected_versions":">=7.4"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"npm install @babel/preset-env @babel/preset-react --save-dev","cause":"Missing peer dependency @babel/preset-env","error":"Error: Cannot find module '@babel/preset-env'"},{"fix":"Use ['babel-preset-o', { modules: 'commonjs' }] instead of ['babel-preset-o', { modules: 'commonjs' }] (check nesting).","cause":"Preset not wrapped in an array with name","error":"Preset options object is not being applied"},{"fix":"Set runtime: 'automatic' or add import React from 'react' in every JSX file.","cause":"Default runtime is 'classic', requires React in scope","error":"JSX not transpiled, React is undefined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}