{"id":15369085,"url":"https://github.com/developit/modify-babel-preset","last_synced_at":"2025-04-09T08:12:30.167Z","repository":{"id":57300566,"uuid":"49351649","full_name":"developit/modify-babel-preset","owner":"developit","description":":dizzy: Create a modified babel preset based on an an existing preset.","archived":false,"fork":false,"pushed_at":"2018-07-04T11:46:01.000Z","size":30,"stargazers_count":85,"open_issues_count":4,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-01T22:10:00.594Z","etag":null,"topics":["babel","babel-plugin","babel-preset"],"latest_commit_sha":null,"homepage":"http://npm.im/modify-babel-preset","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/developit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-10T03:22:30.000Z","updated_at":"2022-02-05T19:19:38.000Z","dependencies_parsed_at":"2022-09-10T10:03:02.940Z","dependency_job_id":null,"html_url":"https://github.com/developit/modify-babel-preset","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developit%2Fmodify-babel-preset","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developit%2Fmodify-babel-preset/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developit%2Fmodify-babel-preset/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developit%2Fmodify-babel-preset/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/developit","download_url":"https://codeload.github.com/developit/modify-babel-preset/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247999864,"owners_count":21031046,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["babel","babel-plugin","babel-preset"],"created_at":"2024-10-01T13:34:03.994Z","updated_at":"2025-04-09T08:12:30.143Z","avatar_url":"https://github.com/developit.png","language":"JavaScript","readme":"\n# modify-babel-preset\n\n[![npm](https://img.shields.io/npm/v/modify-babel-preset.svg)](http://npm.im/modify-babel-preset)\n[![npm](https://img.shields.io/npm/dm/modify-babel-preset.svg)](http://npm.im/modify-babel-preset)\n[![travis](https://travis-ci.org/developit/modify-babel-preset.svg?branch=master)](https://travis-ci.org/developit/modify-babel-preset)\n\n\nCreate a modified babel preset based on an an existing preset.\n\n\u003e Works best with `npm 3`.\n\n\n```sh\nnpm i -S modify-babel-preset\n```\n\n\n---\n\n\n- [API](#api)\n\t- [Add/Update Plugins](#addupdate-plugins)\n\t- [Remove Plugins](#remove-plugins)\n- [Example](#example)\n\n\n  ---\n\n\n## API\n\nA single function that takes an existing preset name and a mapping of plugin modifications to apply to that preset.  _Make sure you have the preset and any added plugins installed as dependencies._\n\n```js\nnewPreset = modifyBabelPreset(\n\t'existing-preset-name',\n\t{\n\t\t'plugin-name': false,  // remove\n\t\t'other-plugin': true,  // add\n\t\t'foo': { loose:true }  // add + config\n\t}\n);\n```\n\n\u003e Modification keys are babel plugin names _(you can exclude the `babel-plugin-` prefix)._\n\n\n### Add/Update Plugins\n\nTo add a plugin, pass `true`, or a configuration object:\n\n```js\n{\n\t// just add a plugin without config:\n\t'plugin-name': true,\n\n\t// add a plugin and set its config\n\t'other-plugin': { loose:true }\n}\n```\n\n\u003e **Note:** adding a plugin that is already provided by the preset just overwrites its configuration.\n\n\n### Remove Plugins\n\nTo remove a plugin, pass `false`:\n\n```js\n{\n\t'plugin-name': false\n}\n```\n\n\n---\n\n\n## Example\n\nHere's a simple preset. Just this `index.js` and a package.json pointing to it with the preset and plugin installed as dependencies.\n\n```js\nvar modifyBabelPreset = require('modify-babel-preset');\n\n// just export the cloned, modified preset config:\nmodule.exports = modifyBabelPreset('es2015', {\n\n\t// remove the typeof x==='symbol' transform:\n\t'transform-es2015-typeof-symbol': false,\n\n\t// add the JSX transform:\n\t'transform-react-jsx': true\n\n});\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevelopit%2Fmodify-babel-preset","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevelopit%2Fmodify-babel-preset","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevelopit%2Fmodify-babel-preset/lists"}