{"id":19301,"library":"babel-preset-jaid","title":"babel-preset-jaid","description":"A personal Babel preset collection by Jaid that aims to minimize boilerplate for JavaScript projects. Current stable version is v17.0.0, released in 2022. The preset includes curated plugins for modern JavaScript, React, and optional minification. Key differentiators: pure ESM exports since v17, custom options for React (false/true/\"lib\"/\"dom\"/\"dom-lib\"), and built-in path aliases. It differs from other presets like @babel/preset-env by bundling multiple plugins into a single config, reducing setup overhead. Maintenance is sporadic, with breaking changes across major versions.","status":"active","version":"17.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/jaid/babel-preset-jaid","tags":["javascript","babel","babel-config","babel-preset","babeljs","dont-repeat-yourself","dry","jaid"],"install":[{"cmd":"npm install babel-preset-jaid","lang":"bash","label":"npm"},{"cmd":"yarn add babel-preset-jaid","lang":"bash","label":"yarn"},{"cmd":"pnpm add babel-preset-jaid","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required for Babel compilation.","package":"@babel/core","optional":false},{"reason":"Optional CLI dependency for command-line compilation.","package":"@babel/cli","optional":true}],"imports":[{"note":"ESM-only since v17; do not use require().","wrong":"const preset = require('babel-preset-jaid')","symbol":"default","correct":"import preset from 'babel-preset-jaid'"},{"note":"TypeScript type export, runtime import will fail. Use 'import type'.","wrong":"import { PluginConfig } from 'babel-preset-jaid'","symbol":"PluginConfig","correct":"import type { PluginConfig } from 'babel-preset-jaid'"},{"note":"Since ESM-only, require() returns an object with .default. Use this pattern in CommonJS .babelrc.js files.","wrong":"module.exports = require('babel-preset-jaid')","symbol":"default (in .babelrc.js)","correct":"module.exports = require('babel-preset-jaid').default"}],"quickstart":{"code":"// Install: npm install --save-dev babel-preset-jaid\n// .babelrc\n{\n  \"presets\": [\n    [\"babel-preset-jaid\", {\n      \"react\": true,\n      \"minify\": false,\n      \"target\": \"node\"\n    }]\n  ]\n}\n\n// Or programmatically (ESM):\nimport preset from 'babel-preset-jaid';\nconst options = { react: true, minify: false, target: 'node' };\nconst config = preset({}, options);\nconsole.log('Configured Babel with preset', Object.keys(config));\n","lang":"javascript","description":"Shows typical .babelrc usage and programmatic ESM import with options for React, minification, and target."},"warnings":[{"fix":"Switch to import syntax or update to latest version. For .babelrc.js, use module.exports = require('babel-preset-jaid').default.","message":"v17.0.0: Enabled ESM by default. The package now only exports ESM; CommonJS require() breaks.","severity":"breaking","affected_versions":">=17"},{"fix":"Update react option to one of the allowed string values or boolean.","message":"v13.0.0: Option 'react' must now be false, true, \"lib\", \"dom\", or \"dom-lib\". Boolean true/false no longer sufficient.","severity":"breaking","affected_versions":">=13"},{"fix":"If you need ava or flow support, pin to v11 or add the plugins manually.","message":"v12.0.0: Removed support for ava and flow. Plugins for these are no longer included.","severity":"breaking","affected_versions":"12"},{"fix":"Configure path aliases manually in your project if needed.","message":"v14.0.0: Temporarily disabled reading Jest config; path aliases are now static (root, src, lib).","severity":"breaking","affected_versions":"14"},{"fix":"If using react-hot-loader, migrate to react-refresh. The preset now uses react-refresh/babel.","message":"v13.1.0: Switched from react-hot-loader/babel to react-refresh/babel. The old plugin is deprecated.","severity":"deprecated","affected_versions":">=13.1"},{"fix":"Update to v17 which is ESM-only, or configure your bundler to handle CommonJS.","message":"The preset uses dynamic requires internally; may cause issues with bundlers that don't support CommonJS in dependencies.","severity":"gotcha","affected_versions":"<17"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run npm install --save-dev babel-preset-jaid@^17.0.0","cause":"Package not installed or incorrect path.","error":"Error: Cannot find module 'babel-preset-jaid'"},{"fix":"Use import syntax or use require('babel-preset-jaid').default in CommonJS.","cause":"Using CommonJS require() with ESM-only package (v17+).","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module"},{"fix":"Set react option to one of: false, true, 'lib', 'dom', 'dom-lib'.","cause":"V13+ changed react option to accept only specific string values.","error":"Error: preset-jaid: Unknown option 'react' with value 'string'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}