{"id":19266,"library":"babel-preset-compat","title":"babel-preset-compat","description":"A Babel preset that enables COMPAT mode for JavaScript transpilation, targeting older browsers and environments. Current stable version is 0.22.4. This package is part of the compat ecosystem, designed to simplify polyfilling and transpilation for maximum compatibility with legacy platforms. It differentiates itself by focusing specifically on 'compat' mode, reducing config overhead. However, it lacks documentation and has been in maintenance mode with no recent updates.","status":"active","version":"0.22.4","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install babel-preset-compat","lang":"bash","label":"npm"},{"cmd":"yarn add babel-preset-compat","lang":"bash","label":"yarn"},{"cmd":"pnpm add babel-preset-compat","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Default import; CJS users can use require('babel-preset-compat') directly.","wrong":"const compatPreset = require('babel-preset-compat').default","symbol":"default","correct":"import compatPreset from 'babel-preset-compat'"},{"note":"For Babel config, you typically use the preset directly as a function or reference.","wrong":"export default { presets: ['babel-preset-compat'] }","symbol":"config","correct":"import compatPreset from 'babel-preset-compat'; export default { presets: [compatPreset] }"},{"note":"In CJS, require the module directly; string references may not work.","wrong":"module.exports = { presets: ['babel-preset-compat'] }","symbol":"preset","correct":"module.exports = { presets: [ require('babel-preset-compat') ] }"}],"quickstart":{"code":"// Install: npm install --save-dev babel-preset-compat\n// Then in babel.config.js:\nmodule.exports = {\n  presets: [\n    ['babel-preset-compat', {\n      targets: { ie: '11', chrome: '49' }\n    }]\n  ]\n};","lang":"javascript","description":"Demonstrates basic usage of the preset with custom targets for legacy browsers."},"warnings":[{"fix":"Visit source code or use with caution; defaults may be unexpected.","message":"No README provided; configuration options are undocumented.","severity":"gotcha","affected_versions":"*"},{"fix":"Consider using @babel/preset-env with appropriate targets instead.","message":"Package has not been updated in over 2 years; may not support modern syntax.","severity":"deprecated","affected_versions":"*"},{"fix":"Pin exact version and test thoroughly.","message":"Version 0.x has unstable API; breaking changes may occur between minor versions.","severity":"breaking","affected_versions":">=0.22.0 <1.0.0"}],"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-compat'.","cause":"Package not installed or not in node_modules.","error":"Cannot find module 'babel-preset-compat'"},{"fix":"Refer to source code for valid options; typical options include 'targets'.","cause":"Invalid or unsupported option passed to preset.","error":"Preset threw error: unknown option '...'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}