Skip to content

Cannot set core-js version for helper-only transformation in @babel/tranform-runtime #9903

@haoqunjiang

Description

@haoqunjiang

Feature Request

Is your feature request related to a problem? Please describe.

Basically we are trying to resolve this issue in @vue/babel-preset-app:

#6628
How can we write ES20xx and ship the smallest amount of code (for a given target environment)?

To be more specific, this item:

  • To achieve that we need to combine @babel/preset-env with @babel/transform-runtime, and the latter one is only used to do helper transformation.
  • The default runtime has a blocking issue though, see 'Symbol' is undefined problem in ie11 #7597
  • So to circumvent it we have to use @babel/runtime-corejs2. I know it's not the best solution but it's an acceptable compromise/tradeoff in practice.
  • Before beta.56 we were able to disable polyfills option while still referring the helper functions to @babel/runtime-corejs2.
  • But after this commit, polyfills option is removed because it is now the default behavior.
  • An unintended consequence is that we can no longer point helpers to any other runtime package without introducing core-js polyfills along with it.

Describe the solution you'd like

Bring back the polyfills option, allowing the user to opt-out it while still being able to specify a core-js version for helpers.

Describe alternatives you've considered
N/A

Teachability, Documentation, Adoption, Migration Strategy
N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    outdatedA closed issue/PR that is archived due to age. Recommended to make a new issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions