Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

babel-polyfill: generate individual files for each shim #5553

Closed
hzoo opened this issue Mar 27, 2017 · 2 comments
Closed

babel-polyfill: generate individual files for each shim #5553

hzoo opened this issue Mar 27, 2017 · 2 comments
Labels
help wanted outdated A closed issue/PR that is archived due to age. Recommended to make a new issue
Milestone

Comments

@hzoo
Copy link
Member

hzoo commented Mar 27, 2017

Choose one: is this a bug report or feature request?: feature request

Expected Behavior

it would be more intuitive and also less weird (for npm 2, yarn?) if babel-preset-env just changed into babel-polyfill still

import "core-js/string.pad-start";
import "core-js/string.pad-end";

Current Behavior

Currently https://github.com/babel/babel-preset-env/#usebuiltins turns

import "babel-polyfill";

into

import "core-js/modules/es7.string.pad-start";
import "core-js/modules/es7.string.pad-end";

Possible Solution

Generate the extra module files to be used by preset-env instead of just the one polyfill.js file in https://github.com/babel/babel/blob/7.0/packages/babel-polyfill/src/index.js.

Need to modify https://github.com/babel/babel/blob/7.0/packages/babel-polyfill/scripts/build-dist.sh to generate the individual polyfills

@andimarek
Copy link

Hi,

I would help with this issue, but I need a bit guidance. :-)

Shouldn't the expected behavior to be imports from babel-polyfill:

import "babel-polyfill/string.pad-start";
import "babel-polyfill/string.pad-end";

instead from core-js?

Otherwise generating new module files in babel-polyfill wouldn't make much sense, I think.

Thanks,
Andi

@hzoo
Copy link
Member Author

hzoo commented Apr 7, 2017

@andimarek yeah must of been my typo

Done in #5584 and released with alpha 7

@hzoo hzoo closed this as completed Apr 7, 2017
@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label May 4, 2018
@lock lock bot locked as resolved and limited conversation to collaborators May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted outdated A closed issue/PR that is archived due to age. Recommended to make a new issue
Projects
None yet
Development

No branches or pull requests

2 participants