Skip to content

Commit

Permalink
docs: Babel 8 default targets (#2774)
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed May 8, 2023
1 parent feecc79 commit 3a33b42
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/options.md
Expand Up @@ -365,6 +365,8 @@ If a minor version is not specified, Babel will interpret it as `MAJOR.0`. For e

#### No targets

:::babel7

When no targets are specified: Babel will assume you are targeting the oldest browsers possible. For example, `@babel/preset-env` will transform all ES2015-ES2020 code to be ES5 compatible.

> We recommend setting `targets` to reduce the output code size.
Expand All @@ -385,6 +387,14 @@ Because of this, Babel's behavior is different than [browserslist](https://githu

We recognize this isn’t ideal and will be revisiting this in Babel v8.

:::

:::babel8

When no targets are specified: Babel will assume you are using the [browserslist](https://github.com/browserslist/browserslist#queries) [`defaults`](https://browsersl.ist/#q=defaults) query, which covers most modern browsers. If you want to support legacy browsers, specify the `targets` option.

:::

#### `targets.esmodules`

Type: `boolean`
Expand Down

0 comments on commit 3a33b42

Please sign in to comment.