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

How do I set my babelrc to let it not polyfill array.push because I am satisfied with browsers' implementation for array.push #1311

Closed
qiulang opened this issue Nov 27, 2023 · 2 comments
Labels

Comments

@qiulang
Copy link

qiulang commented Nov 27, 2023

Hi, this is a question I don't know whether I should raise to corejs or babeljs. I don't want babel to polyfill array.push. But how ?

I have the following .babelrc but I still see array.push is injected.

                    "useBuiltIns": "usage",
                    "shippedProposals": true,
                    "corejs": {
                        "version": 3.33
                        "proposals": false
                    }

After all, this is a very basic array function I am happy with browsers' (chromium browsers) implementation.

I read the array.push but it is not clear to me how you implement push function.

@zloirock
Copy link
Owner

Array#push is polyfilled in modern V8 -> Chrome because of a bug in some specific cases, the info you could find in the files that you mentioned.

You could use exclude preset-env option to exclude this polyfill.

It's not the correct place for questions about .babelrc, it's better to ask Babel team about it.

@zloirock
Copy link
Owner

An example of usage exclude option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants