babel / babel/website

require("corejs") vs 'import "core-js/stable"'

Open
#2,251 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
777
Forks
1.4k
Avg merge
16h 45m
Merged PRs (30d)
3

Description

https://babeljs.io/docs/en/babel-preset-env#usebuiltins-entry says:
> This option enables a new plugin that replaces the `import "core-js/stable"` and `import "regenerator-runtime/runtime"` statements (or `require("corejs")` and `require("regenerator-runtime/runtime")`) with individual requires to different core-js entry points based on environment.

Does it mean, that `import core-js/stable` relates to `require('corejs')` in the same way ES6-modules relate to commonJS, and are otherwise equivallent despite the semi-present *stable*?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the linked Babel preset-env useBuiltIns documentation and compare its descriptions of `import "core-js/stable"` and `require("corejs")`. Determine what distinction the documentation needs to explain, then update the relevant wording so the relationship and the meaning of `stable` are unambiguous.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.