From 321993e68fa05fa1efbce1e33c64f06913f16dfb Mon Sep 17 00:00:00 2001 From: Ed Preston Date: Fri, 27 Jan 2023 16:43:14 +1100 Subject: [PATCH 1/2] Update preset-env.md Clarify exception to "targets" handling for backward compatibility. https://github.com/babel/babel/issues/15371#issuecomment-1404849205 --- docs/preset-env.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/preset-env.md b/docs/preset-env.md index 38883fd66d..05402cdfcb 100644 --- a/docs/preset-env.md +++ b/docs/preset-env.md @@ -82,10 +82,12 @@ For more information on setting options for a preset, refer to the [preset optio ### `targets` -`string | Array | { [string]: string }`, defaults to the top-level `targets` option if no browserslist-related option is specified in `@babel/preset-env`'s docs, otherwise to `{}`. +`string | Array | { [string]: string }`, defaults to the top-level `targets` option if no [browserslist config sources](https://github.com/ai/browserslist#queries) are specified, otherwise to `{}`. For usage, refer to the [`targets` option](options.md#targets) documentation. +> To maintain backward compatibility, `esmodules` is only intersected with `browsers` when using a top-level `targets` option or browserslist config source. + ### `bugfixes` `boolean`, defaults to `false`. From 4187d71f657e2e6a98f03c7cfa6f9d30163f32c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Fri, 3 Mar 2023 19:19:33 -0500 Subject: [PATCH 2/2] Update docs/preset-env.md --- docs/preset-env.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/preset-env.md b/docs/preset-env.md index 05402cdfcb..78c137365a 100644 --- a/docs/preset-env.md +++ b/docs/preset-env.md @@ -82,7 +82,7 @@ For more information on setting options for a preset, refer to the [preset optio ### `targets` -`string | Array | { [string]: string }`, defaults to the top-level `targets` option if no [browserslist config sources](https://github.com/ai/browserslist#queries) are specified, otherwise to `{}`. +`string | Array | { [string]: string }`, defaults to the top-level [`targets` option](options.md#targets) if [`configPath`](#configpath), [`browserslistEnv`](#browserslistenv) and [`ignoreBrowserslistConfig`](#ignorebrowserslistconfig) are not specified, otherwise to `{}`. For usage, refer to the [`targets` option](options.md#targets) documentation.