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

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

Open dilyanpalauzov opened 4 years ago

dilyanpalauzov commented 4 years ago

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?

babel-bot commented 4 years ago

Hey @dilyanpalauzov! 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.

nicolo-ribaudo commented 3 years ago

Uh no:

Babel handles both imports, but do you want to open a PR to align the import and require examples?

nicolo-ribaudo commented 3 years ago

Whops, I noticed now that this issue is one year old. Anyway, the problem is still there if anyone wants to help!