{"_id":"babel-merge","_rev":"339967","name":"babel-merge","description":"`babel-merge` merges multiple Babel configuration objects into a single copy. Plugin and preset objects and arrays will be merged together.","dist-tags":{"latest":"3.0.0"},"maintainers":[{"name":"edmorley","email":"edmorley@users.noreply.github.com"},{"name":"eliperelman","email":""},{"name":"helfi92","email":"helfi92@gmail.com"},{"name":"timkelty","email":""}],"time":{"modified":"2025-10-13T19:28:33.000Z","created":"2017-06-16T22:41:14.419Z","3.0.0":"2019-04-26T20:56:35.700Z","2.0.1":"2018-08-06T14:49:45.414Z","2.0.0":"2018-07-19T14:56:27.830Z","1.1.1":"2018-03-29T14:14:35.946Z","1.1.0":"2017-09-14T14:29:29.109Z","1.0.2":"2017-06-17T02:51:01.278Z","1.0.1":"2017-06-16T22:43:25.699Z","1.0.0":"2017-06-16T22:41:14.419Z"},"users":{},"author":{"name":"Eli Perelman","email":"eli@eliperelman.com"},"repository":{"type":"git","url":"git+https://github.com/neutrinojs/babel-merge.git"},"versions":{"3.0.0":{"name":"babel-merge","version":"3.0.0","main":"src/index.js","author":{"name":"Eli Perelman","email":"eli@eliperelman.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/neutrinojs/babel-merge.git"},"engines:":{"node":">=6.10.0"},"scripts":{"test":"ava --fail-fast test/babel-merge_test.js"},"dependencies":{"deepmerge":"^2.2.1","object.omit":"^3.0.0"},"devDependencies":{"@babel/cli":"^7.4.3","@babel/core":"^7.4.3","@babel/plugin-proposal-class-properties":"^7.4.0","@babel/plugin-proposal-object-rest-spread":"^7.4.3","@babel/plugin-syntax-dynamic-import":"^7.2.0","@babel/preset-env":"^7.4.3","@babel/register":"^7.4.0","ava":"^1.4.1","fast-async":"^6.3.7"},"peerDependencies":{"@babel/core":"^7.0.0"},"gitHead":"87e7dad39804dd52d5ee64d4d8d5151b8ab52c80","description":"`babel-merge` merges multiple Babel configuration objects into a single copy. Plugin and preset objects and arrays will be merged together.","bugs":{"url":"https://github.com/neutrinojs/babel-merge/issues"},"homepage":"https://github.com/neutrinojs/babel-merge#readme","_id":"babel-merge@3.0.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.2","_npmUser":{"name":"eliperelman","email":"eli@eliperelman.com"},"dist":{"shasum":"9bd368d48116dab18b8f3e8022835479d80f3b50","size":49486,"noattachment":false,"key":"/babel-merge/-/babel-merge-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/babel-merge/download/babel-merge-3.0.0.tgz"},"maintainers":[{"name":"edmorley","email":"edmorley@users.noreply.github.com"},{"name":"eliperelman","email":""},{"name":"helfi92","email":"helfi92@gmail.com"},{"name":"timkelty","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/babel-merge_3.0.0_1556312195531_0.8929864051134186"},"_hasShrinkwrap":false,"publish_time":1556312195700,"_cnpm_publish_time":1556312195700,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"2.0.1":{"name":"babel-merge","version":"2.0.1","main":"dist","author":{"name":"Eli Perelman","email":"eli@eliperelman.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/eliperelman/babel-merge.git"},"engines:":{"node":">=6.10.0"},"scripts":{"build":"babel src --copy-files --out-dir dist --source-maps inline","clean":"rimraf dist","prebuild":"yarpm run clean","precommit":"yarpm test","prepublishOnly":"yarpm run build","test":"BABEL_ENV=test nyc mocha 'test/**/*.test.js' -r @babel/register"},"dependencies":{"@babel/core":"^7.0.0-beta.49","deepmerge":"^2.1.0","object.omit":"^3.0.0"},"devDependencies":{"@babel/cli":"^7.0.0-beta.49","@babel/plugin-proposal-class-properties":"^7.0.0-beta.49","@babel/plugin-proposal-object-rest-spread":"^7.0.0-beta.49","@babel/plugin-syntax-dynamic-import":"^7.0.0-beta.49","@babel/preset-env":"^7.0.0-beta.49","@babel/register":"^7.0.0-beta.49","babel-plugin-istanbul":"^4.1.6","fast-async":"^6.3.7","husky":"^0.14.3","mocha":"^5.2.0","nyc":"^12.0.2","rimraf":"^2.6.2","yarpm":"^0.2.1"},"gitHead":"aed8fa5f8ec7486da11ed1db47e445cf6d4facc5","description":"`babel-merge` merges multiple Babel configuration objects into a single copy. Plugin and preset objects and arrays will be merged together.","bugs":{"url":"https://github.com/eliperelman/babel-merge/issues"},"homepage":"https://github.com/eliperelman/babel-merge#readme","_id":"babel-merge@2.0.1","_npmVersion":"6.1.0","_nodeVersion":"10.7.0","_npmUser":{"name":"eliperelman","email":"eli@eliperelman.com"},"dist":{"shasum":"6b2dfad78a655df66e3418eb37b1c3c5e676ad1a","size":39735,"noattachment":false,"key":"/babel-merge/-/babel-merge-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/babel-merge/download/babel-merge-2.0.1.tgz"},"maintainers":[{"name":"edmorley","email":"edmorley@users.noreply.github.com"},{"name":"eliperelman","email":""},{"name":"helfi92","email":"helfi92@gmail.com"},{"name":"timkelty","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/babel-merge_2.0.1_1533566984795_0.2266683928333446"},"_hasShrinkwrap":false,"publish_time":1533566985414,"_cnpm_publish_time":1533566985414,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"2.0.0":{"name":"babel-merge","version":"2.0.0","main":"dist","author":{"name":"Eli Perelman","email":"eli@eliperelman.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/eliperelman/babel-merge.git"},"engines:":{"node":">=6.10.0"},"scripts":{"build":"babel src --copy-files --out-dir dist --source-maps inline","clean":"rimraf dist","prebuild":"yarpm run clean","precommit":"yarpm test","prepublishOnly":"yarpm run build","test":"BABEL_ENV=test nyc mocha 'test/**/*.test.js' -r @babel/register"},"dependencies":{"@babel/core":"^7.0.0-beta.49","deepmerge":"^2.1.0","is-plain-object":"^2.0.4","object.omit":"^3.0.0"},"devDependencies":{"@babel/cli":"^7.0.0-beta.49","@babel/plugin-proposal-class-properties":"^7.0.0-beta.49","@babel/plugin-proposal-object-rest-spread":"^7.0.0-beta.49","@babel/plugin-syntax-dynamic-import":"^7.0.0-beta.49","@babel/preset-env":"^7.0.0-beta.49","@babel/register":"^7.0.0-beta.49","babel-plugin-istanbul":"^4.1.6","fast-async":"^6.3.7","husky":"^0.14.3","mocha":"^5.2.0","nyc":"^12.0.2","rimraf":"^2.6.2","yarpm":"^0.2.1"},"gitHead":"a7d63b952adc566de1d014b6fce67a8a6758e687","description":"[![NPM version][npm-image]][npm-url] [![NPM downloads][npm-downloads]][npm-url]","bugs":{"url":"https://github.com/eliperelman/babel-merge/issues"},"homepage":"https://github.com/eliperelman/babel-merge#readme","_id":"babel-merge@2.0.0","_npmVersion":"5.6.0","_nodeVersion":"10.2.1","_npmUser":{"name":"eliperelman","email":"eli@eliperelman.com"},"dist":{"shasum":"17c3fd795cc92b306948b1bc2175f89ad6c5a360","size":39790,"noattachment":false,"key":"/babel-merge/-/babel-merge-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/babel-merge/download/babel-merge-2.0.0.tgz"},"maintainers":[{"name":"edmorley","email":"edmorley@users.noreply.github.com"},{"name":"eliperelman","email":""},{"name":"helfi92","email":"helfi92@gmail.com"},{"name":"timkelty","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/babel-merge_2.0.0_1532012187677_0.8237969622123533"},"_hasShrinkwrap":false,"publish_time":1532012187830,"_cnpm_publish_time":1532012187830,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"1.1.1":{"name":"babel-merge","version":"1.1.1","main":"index.js","author":{"name":"Eli Perelman","email":"eli@eliperelman.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/eliperelman/babel-merge.git"},"dependencies":{"deepmerge":"^1.5.1","object.omit":"^3.0.0"},"gitHead":"dc119d78be774f220df9f34fcd1f929ab0de037b","description":"[![NPM version][npm-image]][npm-url] [![NPM downloads][npm-downloads]][npm-url]","bugs":{"url":"https://github.com/eliperelman/babel-merge/issues"},"homepage":"https://github.com/eliperelman/babel-merge#readme","_id":"babel-merge@1.1.1","_npmVersion":"5.6.0","_nodeVersion":"9.9.0","_npmUser":{"name":"eliperelman","email":"eli@eliperelman.com"},"dist":{"shasum":"626af5682cdb99c5ad5675424be868e644173d52","size":7959,"noattachment":false,"key":"/babel-merge/-/babel-merge-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/babel-merge/download/babel-merge-1.1.1.tgz"},"maintainers":[{"name":"edmorley","email":"edmorley@users.noreply.github.com"},{"name":"eliperelman","email":""},{"name":"helfi92","email":"helfi92@gmail.com"},{"name":"timkelty","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/babel-merge_1.1.1_1522332875858_0.8299284163028149"},"_hasShrinkwrap":false,"publish_time":1522332875946,"_cnpm_publish_time":1522332875946,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"1.1.0":{"name":"babel-merge","version":"1.1.0","main":"index.js","author":{"name":"Eli Perelman","email":"eli@eliperelman.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/eliperelman/babel-merge.git"},"dependencies":{"deepmerge":"^1.5.1","object.omit":"^3.0.0"},"gitHead":"223ffb20d1b83f324d9179ff7a85dd2056971563","description":"[![NPM version][npm-image]][npm-url] [![NPM downloads][npm-downloads]][npm-url]","bugs":{"url":"https://github.com/eliperelman/babel-merge/issues"},"homepage":"https://github.com/eliperelman/babel-merge#readme","_id":"babel-merge@1.1.0","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"eliperelman","email":"eli@eliperelman.com"},"dist":{"shasum":"bb7d985a52b44ce82a4cb7bcdd4be60f02b71fbb","size":8456,"noattachment":false,"key":"/babel-merge/-/babel-merge-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/babel-merge/download/babel-merge-1.1.0.tgz"},"maintainers":[{"name":"edmorley","email":"edmorley@users.noreply.github.com"},{"name":"eliperelman","email":""},{"name":"helfi92","email":"helfi92@gmail.com"},{"name":"timkelty","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/babel-merge-1.1.0.tgz_1505399368141_0.7566453327890486"},"directories":{},"publish_time":1505399369109,"_hasShrinkwrap":false,"_cnpm_publish_time":1505399369109,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"1.0.2":{"name":"babel-merge","version":"1.0.2","main":"index.js","author":{"name":"Eli Perelman","email":"eli@eliperelman.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/eliperelman/babel-merge.git"},"dependencies":{"deepmerge":"^1.4.3","object.omit":"^2.0.1"},"gitHead":"4d6950fbf7f175bb09881184df6e2f3b82653b4a","description":"[![NPM version][npm-image]][npm-url] [![NPM downloads][npm-downloads]][npm-url]","bugs":{"url":"https://github.com/eliperelman/babel-merge/issues"},"homepage":"https://github.com/eliperelman/babel-merge#readme","_id":"babel-merge@1.0.2","_npmVersion":"5.0.3","_nodeVersion":"8.1.2","_npmUser":{"name":"eliperelman","email":"eli@eliperelman.com"},"dist":{"shasum":"baa7c1406afa363bd7f30c1863d39223bf02c1a5","size":7808,"noattachment":false,"key":"/babel-merge/-/babel-merge-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/babel-merge/download/babel-merge-1.0.2.tgz"},"maintainers":[{"name":"edmorley","email":"edmorley@users.noreply.github.com"},{"name":"eliperelman","email":""},{"name":"helfi92","email":"helfi92@gmail.com"},{"name":"timkelty","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/babel-merge-1.0.2.tgz_1497667859770_0.13683889992535114"},"directories":{},"publish_time":1497667861278,"_hasShrinkwrap":false,"_cnpm_publish_time":1497667861278,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"1.0.1":{"name":"babel-merge","version":"1.0.1","main":"index.js","author":{"name":"Eli Perelman","email":"eli@eliperelman.com"},"license":"MIT","dependencies":{"deepmerge":"^1.4.3","object.omit":"^2.0.1"},"gitHead":"5b76f3ed42d083f02440356436b33b8a055cba62","description":"[![NPM version][npm-image]][npm-url] [![NPM downloads][npm-downloads]][npm-url]","_id":"babel-merge@1.0.1","_npmVersion":"5.0.3","_nodeVersion":"8.1.2","_npmUser":{"name":"eliperelman","email":"eli@eliperelman.com"},"dist":{"shasum":"065adb3c8a12f436ec4968e8b79e8a124f6a75e1","size":7444,"noattachment":false,"key":"/babel-merge/-/babel-merge-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/babel-merge/download/babel-merge-1.0.1.tgz"},"maintainers":[{"name":"edmorley","email":"edmorley@users.noreply.github.com"},{"name":"eliperelman","email":""},{"name":"helfi92","email":"helfi92@gmail.com"},{"name":"timkelty","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/babel-merge-1.0.1.tgz_1497653004675_0.7266836729831994"},"directories":{},"publish_time":1497653005699,"_hasShrinkwrap":false,"_cnpm_publish_time":1497653005699,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"1.0.0":{"name":"babel-merge","version":"1.0.0","main":"index.js","author":{"name":"Eli Perelman","email":"eli@eliperelman.com"},"license":"MIT","dependencies":{"deepmerge":"^1.4.3","object.omit":"^2.0.1"},"gitHead":"c109b7afe4af73695e5fa659c4d1b67d22a52514","description":"[![NPM version][npm-image]][npm-url] [![NPM downloads][npm-downloads]][npm-url] [![Join Slack][slack-image]][slack-url]","_id":"babel-merge@1.0.0","_npmVersion":"5.0.3","_nodeVersion":"8.1.2","_npmUser":{"name":"eliperelman","email":"eli@eliperelman.com"},"dist":{"shasum":"cb0e438715ae3a8555b797d9cc84159046b6aa1b","size":7462,"noattachment":false,"key":"/babel-merge/-/babel-merge-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/babel-merge/download/babel-merge-1.0.0.tgz"},"maintainers":[{"name":"edmorley","email":"edmorley@users.noreply.github.com"},{"name":"eliperelman","email":""},{"name":"helfi92","email":"helfi92@gmail.com"},{"name":"timkelty","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/babel-merge-1.0.0.tgz_1497652873003_0.7095554748084396"},"directories":{},"publish_time":1497652874419,"_hasShrinkwrap":false,"_cnpm_publish_time":1497652874419,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."}},"readme":"# babel-merge\n\n`babel-merge` merges multiple Babel configuration objects into a single copy.\nPlugin and preset objects and arrays will be merged together.\n\n[![NPM version][npm-image]][npm-url]\n[![NPM downloads][npm-downloads]][npm-url]\n\n_Note: **options** to plugins and presets **will not be merged**, but instead\nreplaced by the last matching item's options. This makes the behavior consistent\nwith how Babel works._\n\n## Requirements\n\n- Node.js v6.10+\n- Yarn or npm client\n\n## Installation\n\n`babel-merge` can be installed via the Yarn or npm clients.\n\n#### Yarn\n\n```bash\n❯ yarn add babel-merge\n```\n\n#### npm\n\n```bash\n❯ npm install --save babel-merge\n```\n\n## Usage\n\n* __merge(a, b, _options_)__\n* __merge.all([a, b, ..., z], _options_)__\n\nWhere `a`, `b`, `z` are [Babel configuration objects](https://babeljs.io/docs/usage/api/#options) and `options` is a [deepmerge](https://github.com/KyleAMathews/deepmerge#api) options object.\n\n```js\nconst merge = require('babel-merge');\n\nconst together = merge(\n  {\n    presets: [\n      ['@babel/preset-env', {\n        targets: {\n          browsers: ['latest 1 Chrome']\n        }\n      }]\n    ]\n  },\n  {\n    presets: [\n      ['@babel/preset-env', {\n        targets: {\n          browsers: ['latest 1 Firefox']\n        }\n      }]\n    ]\n  }\n)\n\nconsole.log(together);\n\n{\n  presets: [\n    ['@babel/preset-env', {\n      targets: {\n        browsers: [\n          'latest 1 Firefox'\n        ]\n      }\n    }]\n  ]\n}\n```\n\nIf a pathname was used in an earlier merge, you can still merge by exact name:\n\n```js\nconst merge = require('babel-merge');\n\nconst together = merge(\n  {\n    presets: [\n      [require.resolve('@babel/preset-env'), {\n        targets: {\n          browsers: ['latest 1 Chrome']\n        }\n      }]\n    ]\n  },\n  {\n    presets: [\n      ['@babel/preset-env', {\n        targets: {\n          browsers: ['latest 1 Firefox']\n        }\n      }]\n    ]\n  }\n)\n\nconsole.log(together);\n\n{\n  presets: [\n    ['/Users/me/code/app/node_modules/@babel/preset-env/lib/index.js', {\n      targets: {\n        browsers: [\n          'latest 1 Firefox'\n        ]\n      }\n    }]\n  ]\n}\n```\n\nEven works for plugins and presets within environments:\n\n```js\nconst merge = require('babel-merge');\n\nconst together = merge(\n  {\n    env: {\n      development: {\n        presets: [\n          [require.resolve('@babel/preset-env'), {\n            targets: {\n              browsers: ['latest 1 Chrome']\n            }\n          }]\n        ]\n      }\n    }\n  },\n  {\n    env: {\n      development: {\n        presets: [\n          ['@babel/preset-env', {\n            targets: {\n              browsers: ['latest 1 Firefox']\n            }\n          }]\n        ]\n      }\n    }\n  }\n)\n\nconsole.log(together);\n\n{\n  env: {\n    development: {\n      presets: [\n        ['/Users/me/code/app/node_modules/@babel/preset-env/lib/index.js', {\n          targets: {\n            browsers: [\n              'latest 1 Firefox'\n            ]\n          }\n        }]\n      ]\n    }\n  }\n}\n```\n\nOrder is preserved between non-option plugins and presets and ones with options:\n\n```js\nconst merge = require('babel-merge');\n\nconst together = merge(\n  {\n    plugins: [\n      'module:fast-async',\n      '@babel/plugin-syntax-dynamic-import'\n    ]\n  },\n  {\n    plugins: [\n      '@babel/plugin-proposal-object-rest-spread',\n      ['module:fast-async', { spec: true }],\n      '@babel/plugin-proposal-class-properties'\n    ]\n  }\n)\n\nconsole.log(together);\n\n{\n  plugins: [\n    ['module:fast-async', { spec: true }],\n    '@babel/plugin-syntax-dynamic-import',\n    '@babel/plugin-proposal-object-rest-spread',\n    '@babel/plugin-proposal-class-properties'\n  ]\n}\n```\n\n[npm-image]: https://img.shields.io/npm/v/babel-merge.svg\n[npm-downloads]: https://img.shields.io/npm/dt/babel-merge.svg\n[npm-url]: https://npmjs.org/package/babel-merge\n","_attachments":{},"homepage":"https://github.com/neutrinojs/babel-merge#readme","bugs":{"url":"https://github.com/neutrinojs/babel-merge/issues"},"license":"MIT"}