Skip to content

Commit

Permalink
add note about preset-env to a few missed plugins (#2485)
Browse files Browse the repository at this point in the history
Fixes #2483
  • Loading branch information
hzoo committed Apr 12, 2021
1 parent cdc9723 commit 70e3cea
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/plugin-proposal-class-properties.md
Expand Up @@ -4,6 +4,8 @@ title: @babel/plugin-proposal-class-properties
sidebar_label: class-properties
---

> **NOTE**: This plugin is included in `@babel/preset-env`
## Example

Below is a class with four class properties which will be transformed.
Expand Down
2 changes: 2 additions & 0 deletions docs/plugin-proposal-private-methods.md
Expand Up @@ -4,6 +4,8 @@ title: @babel/plugin-proposal-private-methods
sidebar_label: private-methods
---

> **NOTE**: This plugin is included in `@babel/preset-env`
<details>
<summary>History</summary>
| Version | Changes |
Expand Down
2 changes: 2 additions & 0 deletions docs/plugin-transform-modules-amd.md
Expand Up @@ -4,6 +4,8 @@ title: @babel/plugin-transform-modules-amd
sidebar_label: AMD
---

> **NOTE**: This plugin is included in `@babel/preset-env` under the `modules` option
This plugin transforms ECMAScript modules to [AMD](https://github.com/amdjs/amdjs-api/blob/master/AMD.md). Note that only the _syntax_ of import/export statements (`import "./mod.js"`) and import expressions (`import('./mod.js')`) is transformed, as Babel is unaware of the different resolution algorithms between implementations of ECMAScript modules and AMD.

## Example
Expand Down
2 changes: 2 additions & 0 deletions docs/plugin-transform-modules-commonjs.md
Expand Up @@ -4,6 +4,8 @@ title: @babel/plugin-transform-modules-commonjs
sidebar_label: Common JS
---

> **NOTE**: This plugin is included in `@babel/preset-env` under the `modules` option
This plugin transforms ECMAScript modules to [CommonJS](http://wiki.commonjs.org/wiki/Modules/1.1). Note that only the _syntax_ of import/export statements (`import "./mod.js"`) and import expressions (`import('./mod.js')`) is transformed, as Babel is unaware of different resolution algorithms between implementations of ECMAScript modules and CommonJS.

## Example
Expand Down
2 changes: 2 additions & 0 deletions docs/plugin-transform-modules-systemjs.md
Expand Up @@ -4,6 +4,8 @@ title: @babel/plugin-transform-modules-systemjs
sidebar_label: SystemJS
---

> **NOTE**: This plugin is included in `@babel/preset-env` under the `modules` option
This plugin transforms ECMAScript modules to [SystemJS](https://github.com/systemjs/systemjs/blob/master/docs/system-register.md). Note that only the _syntax_ of import/export statements (`import "./mod.js"`) and import expressions (`import('./mod.js')`) is transformed, as Babel is unaware of different resolution algorithms between implementations of ECMAScript modules and SystemJS.

## Example
Expand Down
2 changes: 2 additions & 0 deletions docs/plugin-transform-modules-umd.md
Expand Up @@ -4,6 +4,8 @@ title: @babel/plugin-transform-modules-umd
sidebar_label: UMD
---

> **NOTE**: This plugin is included in `@babel/preset-env` under the `modules` option
This plugin transforms ES2015 modules to [UMD](https://github.com/umdjs/umd). Note that only the _syntax_ of import/export statements (`import "./mod.js"`) is transformed, as Babel is unaware of different resolution algorithms between implementations of ES2015 modules and UMD.

⚠️ This plugin does not support dynamic import (`import('./lazy.js')`).
Expand Down
2 changes: 2 additions & 0 deletions docs/plugin-transform-regenerator.md
Expand Up @@ -4,6 +4,8 @@ title: @babel/plugin-transform-regenerator
sidebar_label: regenerator
---

> **NOTE**: This plugin is included in `@babel/preset-env`
## Example

**In**
Expand Down
2 changes: 1 addition & 1 deletion docs/preset-env.md
Expand Up @@ -30,7 +30,7 @@ yarn add @babel/preset-env --dev

We leverage these data sources to maintain [mappings of which version](https://github.com/babel/babel/blob/master/packages/babel-compat-data/data/plugins.json) of our supported target environments gained support of a JavaScript syntax or browser feature, as well as a mapping of those syntaxes and features to Babel transform plugins and core-js polyfills.

> It is important to note that `@babel/preset-env` does _not_ support `stage-x` plugins.
> Note: `@babel/preset-env` won't include any JavaScript syntax proposals less than Stage 3 because at that stage in the TC39 process, it wouldn't be implemented by any browsers anyway. Those would need to be included manually. The `shippedProposals` option will include Stage 3 proposals that some browsers have already implemented.
`@babel/preset-env` takes any [target environments you've specified](#targets) and checks them against its mappings to compile a list of plugins and passes it to Babel.

Expand Down

0 comments on commit 70e3cea

Please sign in to comment.