[Docs] Make it clear what dependencies should be imported when using @babel/preset-env together with useBuiltIns options
- Dominant language
- TypeScript
- Stars
- 777
- Forks
- 1.4k
- Avg merge
- 16h 45m
- Merged PRs (30d)
- 3
Description
Hi,
I've read the [`@babel/preset-env` documentation](https://babeljs.io/docs/en/babel-preset-env) several times, but I'm still not 100% sure If I get it all correctly.
To me, it seems that:
- when `@babel/preset-env` is used together with `useBuiltIns: 'usage'` then no additional dependencies need to be imported in our entry file. Babel will pick and import all the polyfills for us based on features used in the transpiled code (and based on an additional configuration like browserslist config or `target` config option).
- when we use `useBuiltIns: 'entry'` then we need to add the following lines to our entry file:
```
import 'core-js/stable';
import 'regenerator-runtime/runtime';
```
- when we use `useBuiltIns: false` then we have to import the entire `@babel/polyfill` or import individual polyfills.
Both: `usage` and `entry` options require the `core-js` lib to be installed.
---
Could you improve the docs and make it really clear? Some examples would be very helpful.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the linked @babel/preset-env documentation and review the sections for useBuiltIns: 'usage', 'entry', and false. Clarify which imports and dependencies each option requires, add examples for the entry-file cases, and consider the existing statements about core-js, @babel/polyfill, and regenerator-runtime complete when the dependency guidance is unambiguous.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100