{"id":19181,"library":"babel-plugin-transform-builtin-extend","title":"babel-plugin-transform-builtin-extend","description":"A Babel 6 plugin that enables extending built-in JavaScript types like Error and Array, which require special handling due to their native constructor behavior. It uses static analysis to detect class extensions of globals you specify, optionally with an approximate mode for IE <= 10. This plugin is a specialized tool for a now-legacy Babel version (6.x) and has been superseded by native class support in modern JavaScript and Babel 7+. No active maintenance since 2016.","status":"deprecated","version":"1.1.2","language":"javascript","source_language":"en","source_url":"https://github.com/loganfsmyth/babel-plugin-transform-builtin-extend","tags":["javascript","babel","babel-plugin","es6","classes"],"install":[{"cmd":"npm install babel-plugin-transform-builtin-extend","lang":"bash","label":"npm"},{"cmd":"yarn add babel-plugin-transform-builtin-extend","lang":"bash","label":"yarn"},{"cmd":"pnpm add babel-plugin-transform-builtin-extend","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This is a Babel plugin, not a runtime import. It must be configured in Babel 6 config.","wrong":"Using require('babel-plugin-transform-builtin-extend') in code","symbol":"plugin (default)","correct":"In .babelrc: [\"babel-plugin-transform-builtin-extend\", { globals: [\"Error\", \"Array\"] }]"}],"quickstart":{"code":"{\n  \"plugins\": [\n    [\"babel-plugin-transform-builtin-extend\", {\n      \"globals\": [\"Error\", \"Array\"],\n      \"approximate\": false\n    }]\n  ]\n}","lang":"javascript","description":"Shows Babel 6 configuration to extend Error and Array classes using static analysis."},"warnings":[{"fix":"Upgrade to Babel 7+ and use appropriate modern plugins.","message":"This plugin is for Babel 6 only. Babel 7+ has native support for extending built-ins via @babel/plugin-proposal-class-properties or @babel/plugin-transform-classes.","severity":"deprecated","affected_versions":"all"},{"fix":"Avoid using approximate mode unless targeting legacy browsers and understand the limitations.","message":"The 'approximate' mode for IE <= 10 does not correctly implement built-in extension semantics; it falls back to ES5 inheritance which may not work as expected.","severity":"gotcha","affected_versions":"<=1.1.2"},{"fix":"Do not rely on static inheritance from extended built-ins if targeting IE <= 10.","message":"Static property inheritance relies on __proto__, which is not supported in IE <= 10 and some older browsers.","severity":"gotcha","affected_versions":"<=1.1.2"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"npm install babel-plugin-transform-builtin-extend --save-dev and ensure Babel 6 is used.","cause":"Plugin not installed or used with Babel 7+ (which uses @babel scoped packages).","error":"Error: Cannot find module 'babel-plugin-transform-builtin-extend'"},{"fix":"Enable the 'approximate' option in plugin config, with caveats.","cause":"Code runs in an environment where __proto__ is not supported (e.g., IE <= 10).","error":"ReferenceError: __proto__ is not defined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}