Skip to content

Extend Vue's default polyfills instead of replacing them #3642

Open
@lukasvice

Description

@lukasvice

What problem does this feature solve?

When using the babel-preset-app's polyfills option, the default polyfills are replaced.

I just wanted to include es6.array.find-index using the polyfills option. Suddenly, all the Promise.finally in my source code didn't work anymore in IE11. es6.promise was included properly because of useBuiltIns: 'usage', but es7.promise.finally was not included. Even adding es7.promise.finally to the polyfills option didn't work as expected. I think es6.promise, which is included via usage after the es7.promise.finally pre-include, overrides it. Therefore I had to prepend also es6.promise to the polyfills option.

If you know how the pre-includes and useBuiltIns work, it's probably not a big deal - otherwise it can be tricky.

What does the proposed API look like?

A preset option to extend the default polyfills, instead of replacing them, so we don't have to check the docs to copy/paste the default polyfills.

or

Update the docs, mentioning that the default polyfills are replaced and you likely want to include all the default polyfills first before adding another one.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions