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

Comments

Projects
None yet
2 participants
@hzoo
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

This comment has been minimized.

andimarek commented Apr 3, 2017

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

This comment has been minimized.

Member

hzoo commented Apr 7, 2017

@andimarek yeah must of been my typo

Done in #5584 and released with alpha 7

@hzoo hzoo closed this Apr 7, 2017

@lock lock bot added the outdated 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.