{"id":13508898,"url":"https://github.com/babel/babel-preset-env","last_synced_at":"2025-10-05T17:31:14.486Z","repository":{"id":52564327,"uuid":"65648767","full_name":"babel/babel-preset-env","owner":"babel","description":"PSA: this repo has been moved into babel/babel --\u003e","archived":true,"fork":false,"pushed_at":"2018-05-10T14:31:15.000Z","size":1059,"stargazers_count":3489,"open_issues_count":1,"forks_count":157,"subscribers_count":67,"default_branch":"1.x","last_synced_at":"2025-09-21T06:46:38.900Z","etag":null,"topics":["autoprefixer","babel-preset","es6","javascript","moved"],"latest_commit_sha":null,"homepage":"https://github.com/babel/babel/tree/master/packages/babel-preset-env","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/babel.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["babel"],"open_collective":"babel","custom":"https://gitcoin.co/grants/2906/babel-compiler-for-next-generation-javascript"}},"created_at":"2016-08-14T03:48:33.000Z","updated_at":"2025-09-20T14:17:25.000Z","dependencies_parsed_at":"2022-09-10T18:22:28.198Z","dependency_job_id":null,"html_url":"https://github.com/babel/babel-preset-env","commit_stats":null,"previous_names":[],"tags_count":54,"template":false,"template_full_name":null,"purl":"pkg:github/babel/babel-preset-env","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babel%2Fbabel-preset-env","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babel%2Fbabel-preset-env/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babel%2Fbabel-preset-env/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babel%2Fbabel-preset-env/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/babel","download_url":"https://codeload.github.com/babel/babel-preset-env/tar.gz/refs/heads/1.x","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babel%2Fbabel-preset-env/sbom","scorecard":{"id":222337,"data":{"date":"2025-08-11","repo":{"name":"github.com/babel/babel-preset-env","commit":"31f33e3656e1bd8036317c54128fdc2812a2e8aa"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.4,"checks":[{"name":"Maintained","score":0,"reason":"project is archived","details":["Warn: Repository is archived."],"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":5,"reason":"Found 13/25 approved changesets -- score normalized to 5","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch '1.x'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 20 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"78 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-832h-xg76-4gv6","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx","Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-mh2h-6j8q-x246","Warn: Project is vulnerable to: GHSA-5q88-cjfq-g2mh","Warn: Project is vulnerable to: GHSA-xp63-6vf5-xf3v","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-p28h-cc7q-c4fg","Warn: Project is vulnerable to: GHSA-9vvw-cc9w-f27h","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-hr2v-3952-633q","Warn: Project is vulnerable to: GHSA-h6ch-v84p-w6p9","Warn: Project is vulnerable to: GHSA-4gmj-3p3h-gm8h","Warn: Project is vulnerable to: GHSA-qrmc-fj45-qfc2","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3","Warn: Project is vulnerable to: MAL-2023-462","Warn: Project is vulnerable to: GHSA-xf7w-r453-m56c","Warn: Project is vulnerable to: GHSA-qh2h-chj9-jffq","Warn: Project is vulnerable to: GHSA-q42p-pg8m-cqh6","Warn: Project is vulnerable to: GHSA-w457-6q6x-cgp9","Warn: Project is vulnerable to: GHSA-62gr-4qp9-h98f","Warn: Project is vulnerable to: GHSA-f52g-6jhx-586p","Warn: Project is vulnerable to: GHSA-2cf5-4w76-r9qv","Warn: Project is vulnerable to: GHSA-3cqr-58rm-57f8","Warn: Project is vulnerable to: GHSA-g9r4-xpmj-mj65","Warn: Project is vulnerable to: GHSA-q2c6-c6pm-g3gh","Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44","Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988","Warn: Project is vulnerable to: GHSA-44pw-h2cw-w3vq","Warn: Project is vulnerable to: GHSA-jp4x-w63m-7wgm","Warn: Project is vulnerable to: GHSA-c429-5p7v-vgjp","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-4hpf-3wq7-5rpr","Warn: Project is vulnerable to: GHSA-f522-ffg8-j8r6","Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546","Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-282f-qqgm-c34q","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-fvqr-27wr-82fm","Warn: Project is vulnerable to: GHSA-4xc9-xhrj-v574","Warn: Project is vulnerable to: GHSA-x5rq-j2xg-h7qm","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-w9mr-4mfr-499f","Warn: Project is vulnerable to: GHSA-rp65-9cf3-cjxr","Warn: Project is vulnerable to: GHSA-6394-6h9h-cfjg","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-gqgv-6jq5-jjj9","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-6g33-f262-xjp4","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-4rq4-32rv-6wp6","Warn: Project is vulnerable to: GHSA-64g7-mvw6-v9qj","Warn: Project is vulnerable to: GHSA-2m39-62fm-q8r3","Warn: Project is vulnerable to: GHSA-mf6x-7mm4-x2g7","Warn: Project is vulnerable to: GHSA-j44m-qm6p-hp7m","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-g7q5-pjjr-gqvp","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-xc7v-wxcw-j472","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T02:53:08.551Z","repository_id":52564327,"created_at":"2025-08-17T02:53:08.552Z","updated_at":"2025-08-17T02:53:08.552Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":277010307,"owners_count":25744638,"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","status":"online","status_checked_at":"2025-09-26T02:00:09.010Z","response_time":78,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["autoprefixer","babel-preset","es6","javascript","moved"],"created_at":"2024-08-01T02:01:00.168Z","updated_at":"2025-10-05T17:31:14.441Z","avatar_url":"https://github.com/babel.png","language":"JavaScript","funding_links":["https://github.com/sponsors/babel","https://opencollective.com/babel","https://gitcoin.co/grants/2906/babel-compiler-for-next-generation-javascript"],"categories":["JavaScript","📦 Legacy \u0026 Inactive Projects"],"sub_categories":[],"readme":"# Now that `babel-preset-env` has stabilized, it has been [moved into the main Babel mono-repo](https://github.com/babel/babel/tree/master/packages/babel-preset-env) and this repo has been archived.\n\nThe move makes it much easier to release and develop in sync with the rest of Babel!\n\nThis repo will be made read-only, as all of the issues/labels have been moved over as well. Please report any bugs and open pull requests over on the [main mono-repo](https://github.com/babel/babel).\n\n---\n\n# babel-preset-env [![npm](https://img.shields.io/npm/v/babel-preset-env.svg)](https://www.npmjs.com/package/babel-preset-env) [![travis](https://img.shields.io/travis/babel/babel-preset-env/master.svg)](https://travis-ci.org/babel/babel-preset-env) [![npm-downloads](https://img.shields.io/npm/dm/babel-preset-env.svg)](https://www.npmjs.com/package/babel-preset-env) [![codecov](https://img.shields.io/codecov/c/github/babel/babel-preset-env/master.svg?maxAge=43200)](https://codecov.io/github/babel/babel-preset-env)\n\n\u003e A Babel preset that compiles [ES2015+](https://github.com/tc39/proposals/blob/master/finished-proposals.md) down to ES5 by automatically determining the Babel plugins and polyfills you need based on your targeted browser or runtime environments.\n\n```sh\nnpm install babel-preset-env --save-dev\n```\n\nWithout any configuration options, babel-preset-env behaves exactly the same as babel-preset-latest (or babel-preset-es2015, babel-preset-es2016, and babel-preset-es2017 together).\n\n\u003e However, we don't recommend using `preset-env` this way because it doesn't take advantage of it's greater capabilities of targeting specific browsers.\n\n```json\n{\n  \"presets\": [\"env\"]\n}\n```\n\nYou can also configure it to only include the polyfills and transforms needed for the browsers you support. Compiling only what's needed can make your bundles smaller and your life easier.\n\nThis example only includes the polyfills and code transforms needed for coverage of users \u003e 0.25%, ignoring Internet Explorer 11 and Opera Mini.. We use [browserslist](https://github.com/ai/browserslist) to parse this information, so you can use [any valid query format supported by browserslist](https://github.com/ai/browserslist#queries).\n\n```js\n{\n  \"presets\": [\n    [\"env\", {\n      \"targets\": {\n        // The % refers to the global coverage of users from browserslist\n        \"browsers\": [ \"\u003e0.25%\", \"not ie 11\", \"not op_mini all\"]\n      }\n    }]\n  ]\n}\n```\n\n\u003e You can also target individual versions of browsers instead of using a query with `\"targets\": { \"chrome\": \"52\" }`.\n\nSimilarly, if you're targeting Node.js instead of the browser, you can configure babel-preset-env to only include the polyfills and transforms necessary for a particular version:\n\n```json\n{\n  \"presets\": [\n    [\"env\", {\n      \"targets\": {\n        \"node\": \"6.10\"\n      }\n    }]\n  ]\n}\n```\n\nFor convenience, you can use `\"node\": \"current\"` to only include the necessary polyfills and transforms for the Node.js version that you use to run Babel:\n\n```json\n{\n  \"presets\": [\n    [\"env\", {\n      \"targets\": {\n        \"node\": \"current\"\n      }\n    }]\n  ]\n}\n```\n\nCheck out the many options (especially `useBuiltIns` to polyfill less)!\n\n- [How it Works](#how-it-works)\n- [Install](#install)\n- [Usage](#usage)\n- [Options](#options)\n- [Examples](#examples)\n- [Caveats](#caveats)\n- [Other Cool Projects](#other-cool-projects)\n\n## How it Works\n\n### Determine environment support for ECMAScript features\n\nUse external data such as [`compat-table`](https://github.com/kangax/compat-table) to determine browser support. (We should create PRs there when necessary)\n\n![](https://cloud.githubusercontent.com/assets/588473/19214029/58deebce-8d48-11e6-9004-ee3fbcb75d8b.png)\n\nWe can periodically run [build-data.js](https://github.com/babel/babel-preset-env/blob/master/scripts/build-data.js) which generates [plugins.json](https://github.com/babel/babel-preset-env/blob/master/data/plugins.json).\n\nRef: [#7](https://github.com/babel/babel-preset-env/issues/7)\n\n### Maintain a mapping between JavaScript features and Babel plugins\n\n\u003e Currently located at [plugin-features.js](https://github.com/babel/babel-preset-env/blob/master/data/plugin-features.js).\n\nThis should be straightforward to do in most cases. There might be cases where plugins should be split up more or certain plugins aren't standalone enough (or impossible to do).\n\n### Support all plugins in Babel that are considered `latest`\n\n\u003e Default behavior without options is the same as `babel-preset-latest`.\n\nIt won't include `stage-x` plugins. env will support all plugins in what we consider the latest version of JavaScript (by matching what we do in [`babel-preset-latest`](http://babeljs.io/docs/plugins/preset-latest/)).\n\nRef: [#14](https://github.com/babel/babel-preset-env/issues/14)\n\n### Determine the lowest common denominator of plugins to be included in the preset\n\nIf you are targeting IE 8 and Chrome 55 it will include all plugins required by IE 8 since you would need to support both still.\n\n### Support a target option `\"node\": \"current\"` to compile for the currently running node version.\n\nFor example, if you are building on Node 6, arrow functions won't be converted, but they will if you build on Node 0.12.\n\n### Support a `browsers` option like autoprefixer\n\nUse [browserslist](https://github.com/ai/browserslist) to declare supported environments by performing queries like `\u003e 1%, last 2 versions`.\n\nRef: [#19](https://github.com/babel/babel-preset-env/pull/19)\n\n## Install\n\nWith [npm](https://www.npmjs.com):\n\n```sh\nnpm install --save-dev babel-preset-env\n```\n\nOr [yarn](https://yarnpkg.com):\n\n```sh\nyarn add babel-preset-env --dev\n```\n\n## Usage\n\nThe default behavior without options runs all transforms (behaves the same as [babel-preset-latest](https://babeljs.io/docs/plugins/preset-latest/)).\n\n```json\n{\n  \"presets\": [\"env\"]\n}\n```\n\n## Options\n\nFor more information on setting options for a preset, refer to the [plugin/preset options](http://babeljs.io/docs/plugins/#plugin-preset-options) documentation.\n\n### `targets`\n\n`{ [string]: number | string }`, defaults to `{}`.\n\nTakes an object of environment versions to support.\n\nEach target environment takes a number or a string (we recommend using a string when specifying minor versions like `node: \"6.10\"`).\n\nExample environments: `chrome`, `opera`, `edge`, `firefox`, `safari`, `ie`, `ios`, `android`, `node`, `electron`.\n\nThe [data](https://github.com/babel/babel-preset-env/blob/master/data/plugins.json) for this is generated by running the [build-data script](https://github.com/babel/babel-preset-env/blob/master/scripts/build-data.js) which pulls in data from [compat-table](https://kangax.github.io/compat-table).\n\n### `targets.node`\n\n`number | string | \"current\" | true`\n\nIf you want to compile against the current node version, you can specify `\"node\": true` or `\"node\": \"current\"`, which would be the same as `\"node\": process.versions.node`.\n\n### `targets.browsers`\n\n`Array\u003cstring\u003e | string`\n\nA query to select browsers (ex: last 2 versions, \u003e 5%) using [browserslist](https://github.com/ai/browserslist).\n\nNote, browsers' results are overridden by explicit items from `targets`.\n\n### `targets.uglify`\n\n`true`\n\nWhen using `uglify-js` to minify your code, you may run into syntax errors when targeting later browsers since `uglify-js` does not support any ES2015+ syntax.\n\nTo prevent these errors - set the `uglify` option to `true`, which enables all transformation plugins and as a result, your code is fully compiled to ES5. However, the `useBuiltIns` option will still work as before and only include the polyfills that your target(s) need.\n\n\u003e Uglify has support for ES2015 syntax via [uglify-es](https://github.com/mishoo/UglifyJS2/tree/harmony). If you are using syntax unsupported by `uglify-es`, we recommend using [babel-minify](https://github.com/babel/minify).\n\n\u003e Note: This option is deprecated in 2.x and replaced with a [`forceAllTransforms` option](https://github.com/babel/babel-preset-env/pull/264).\n\n### `spec`\n\n`boolean`, defaults to `false`.\n\nEnable more spec compliant, but potentially slower, transformations for any plugins in this preset that support them.\n\n### `loose`\n\n`boolean`, defaults to `false`.\n\nEnable \"loose\" transformations for any plugins in this preset that allow them.\n\n### `modules`\n\n`\"amd\" | \"umd\" | \"systemjs\" | \"commonjs\" | false`, defaults to `\"commonjs\"`.\n\nEnable transformation of ES6 module syntax to another module type.\n\nSetting this to `false` will not transform modules.\n\n### `debug`\n\n`boolean`, defaults to `false`.\n\nOutputs the targets/plugins used and the version specified in [plugin data version](https://github.com/babel/babel-preset-env/blob/master/data/plugins.json) to `console.log`.\n\n### `include`\n\n`Array\u003cstring\u003e`, defaults to `[]`.\n\n\u003e NOTE: `whitelist` is deprecated and will be removed in the next major in favor of this.\n\nAn array of plugins to always include.\n\nValid options include any:\n\n- [Babel plugins](https://github.com/babel/babel-preset-env/blob/master/data/plugin-features.js) - both with (`babel-plugin-transform-es2015-spread`) and without prefix (`transform-es2015-spread`) are supported.\n\n- [Built-ins](https://github.com/babel/babel-preset-env/blob/master/data/built-in-features.js), such as `map`, `set`, or `object.assign`.\n\nThis option is useful if there is a bug in a native implementation, or a combination of a non-supported feature + a supported one doesn't work.\n\nFor example, Node 4 supports native classes but not spread. If `super` is used with a spread argument, then the `transform-es2015-classes` transform needs to be `include`d, as it is not possible to transpile a spread with `super` otherwise.\n\n\u003e NOTE: The `include` and `exclude` options _only_ work with the [plugins included with this preset](https://github.com/babel/babel-preset-env/blob/master/data/plugin-features.js); so, for example, including `transform-do-expressions` or excluding `transform-function-bind` will throw errors. To use a plugin _not_ included with this preset, add them to your [config](https://babeljs.io/docs/usage/babelrc/) directly.\n\n### `exclude`\n\n`Array\u003cstring\u003e`, defaults to `[]`.\n\nAn array of plugins to always exclude/remove.\n\nThe possible options are the same as the `include` option.\n\nThis option is useful for \"blacklisting\" a transform like `transform-regenerator` if you don't use generators and don't want to include `regeneratorRuntime` (when using `useBuiltIns`) or for using another plugin like [fast-async](https://github.com/MatAtBread/fast-async) instead of [Babel's async-to-gen](http://babeljs.io/docs/plugins/transform-async-generator-functions/).\n\n### `useBuiltIns`\n\n`boolean`, defaults to `false`.\n\nA way to apply `babel-preset-env` for polyfills (via \"babel-polyfill\").\n\n\u003e NOTE: This does not currently polyfill experimental/stage-x built-ins like the regular \"babel-polyfill\" does.\n\u003e This will only work with npm \u003e= 3 (which should be used with Babel 6 anyway)\n\n```\nnpm install babel-polyfill --save\n```\n\nThis option enables a new plugin that replaces the statement `import \"babel-polyfill\"` or `require(\"babel-polyfill\")` with individual requires for `babel-polyfill` based on environment.\n\n\u003e NOTE: Only use `require(\"babel-polyfill\");` once in your whole app.\n\u003e Multiple imports or requires of `babel-polyfill` will throw an error since it can cause global collisions and other issues that are hard to trace.\n\u003e We recommend creating a single entry file that only contains the `require` statement.\n\n**In**\n\n```js\nimport \"babel-polyfill\";\n```\n\n**Out (different based on environment)**\n\n```js\nimport \"core-js/modules/es7.string.pad-start\";\nimport \"core-js/modules/es7.string.pad-end\";\nimport \"core-js/modules/web.timers\";\nimport \"core-js/modules/web.immediate\";\nimport \"core-js/modules/web.dom.iterable\";\n```\n\nThis will also work for `core-js` directly (`import \"core-js\";`)\n\n```\nnpm install core-js --save\n```\n\n---\n\n## Examples\n\n### Export with various targets\n\n```js\nexport class A {}\n```\n\n#### Target only Chrome 52\n\n**.babelrc**\n\n```json\n{\n  \"presets\": [\n    [\"env\", {\n      \"targets\": {\n        \"chrome\": 52\n      }\n    }]\n  ]\n}\n```\n\n**Out**\n\n```js\nclass A {}\nexports.A = A;\n```\n\n#### Target Chrome 52 with webpack 2/rollup and loose mode\n\n**.babelrc**\n\n```json\n{\n  \"presets\": [\n    [\"env\", {\n      \"targets\": {\n        \"chrome\": 52\n      },\n      \"modules\": false,\n      \"loose\": true\n    }]\n  ]\n}\n```\n\n**Out**\n\n```js\nexport class A {}\n```\n\n#### Target specific browsers via browserslist\n\n**.babelrc**\n\n```json\n{\n  \"presets\": [\n    [\"env\", {\n      \"targets\": {\n        \"chrome\": 52,\n        \"browsers\": [\"last 2 versions\", \"safari 7\"]\n      }\n    }]\n  ]\n}\n```\n\n**Out**\n\n```js\nexport var A = function A() {\n  _classCallCheck(this, A);\n};\n```\n\n#### Target latest node via `node: true` or `node: \"current\"`\n\n**.babelrc**\n\n```json\n{\n  \"presets\": [\n    [\"env\", {\n      \"targets\": {\n        \"node\": \"current\"\n      }\n    }]\n  ]\n}\n```\n\n**Out**\n\n```js\nclass A {}\nexports.A = A;\n```\n\n### Show debug output\n\n**.babelrc**\n\n```json\n{\n  \"presets\": [\n    [ \"env\", {\n      \"targets\": {\n        \"safari\": 10\n      },\n      \"modules\": false,\n      \"useBuiltIns\": true,\n      \"debug\": true\n    }]\n  ]\n}\n```\n\n**stdout**\n\n```sh\nUsing targets:\n{\n  \"safari\": 10\n}\n\nModules transform: false\n\nUsing plugins:\n  transform-exponentiation-operator {}\n  transform-async-to-generator {}\n\nUsing polyfills:\n  es7.object.values {}\n  es7.object.entries {}\n  es7.object.get-own-property-descriptors {}\n  web.timers {}\n  web.immediate {}\n  web.dom.iterable {}\n```\n\n### Include and exclude specific plugins/built-ins\n\n\u003e always include arrow functions, explicitly exclude generators\n\n```json\n{\n  \"presets\": [\n    [\"env\", {\n      \"targets\": {\n        \"browsers\": [\"last 2 versions\", \"safari \u003e= 7\"]\n      },\n      \"include\": [\"transform-es2015-arrow-functions\", \"es6.map\"],\n      \"exclude\": [\"transform-regenerator\", \"es6.set\"]\n    }]\n  ]\n}\n```\n\n## Caveats\n\nIf you get a `SyntaxError: Unexpected token ...` error when using the [object-rest-spread](https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-object-rest-spread) transform then make sure the plugin has been updated to, at least, `v6.19.0`.\n\n## Other Cool Projects\n\n- [babel-preset-modern-browsers](https://github.com/christophehurpeau/babel-preset-modern-browsers)\n- ?\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbabel%2Fbabel-preset-env","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbabel%2Fbabel-preset-env","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbabel%2Fbabel-preset-env/lists"}