babel / website

:globe_with_meridians: The Babel documentation website
https://babeljs.io/docs/en/index.html
MIT License
751 stars 1.31k forks source link

@babel/present-env and no targets improvements #2489

Open thernstig opened 3 years ago

thernstig commented 3 years ago

Hi!

I have read https://babeljs.io/docs/en/babel-preset-env#no-targets and think I've gotten the gist of it, but I believe the docs are unclear. I will try to point out why:

  1. The below quote (and the preceding text) it not correct if you have a browserlist config such as .browserlistrc. I feel this text could be made more clear. The subsequent does make it slightly more clear. But I believe the section could be made much more intuitive by starting stating "If you have no browserlist config sources specified..."

We don't recommend using preset-env this way because it doesn't take advantage of its ability to target specific environments/versions.

  1. The below quote states "either explicitly", then I do not see a reason to check the "No targets" section.

Please note that if you are relying on browserslist's defaults query (either explicitly or by having no browserslist config), you will want to check out the No targets section for information on preset-env's behavior.

babel-bot commented 3 years ago

Hey @thernstig! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite.