Skip to content

Guidance on using core-js with modern toolchains (Vite 8 + OXC, no Babel/SWC) #1530

Description

@slavbar

Hi,

First of all, thank you for maintaining core-js, it’s an incredibly valuable project.

I’m opening this issue to ask for guidance regarding the current shift in the frontend ecosystem away from Babel/SWC toward newer toolchains like OXC (now used in Vite 8).


Context

Historically, core-js has been commonly used together with Babel:

  • @babel/preset-env
  • useBuiltIns: 'usage' | 'entry'
  • automatic polyfill injection based on targets

This provided a very convenient and mostly automatic experience.


Current situation

With Vite 8 using OXC, the situation is different:

  • OXC focuses on syntax transforms
  • It does not provide automatic polyfill injection
  • There is no direct equivalent to Babel’s useBuiltIns: 'usage'

As a result, we now need to:

  • manually import core-js, or
  • rely on external plugins (e.g. legacy plugins), or
  • use external polyfill services

Questions

  1. Does core-js have a recommended approach for usage in environments without Babel/SWC?

  2. Is there any official or recommended integration strategy for:

    • Vite 8 (OXC)
    • or similar “no-Babel” toolchains?
  3. Are there any plans (or discussions) around:
    a plugin/tool that can replicate useBuiltIns: 'usage' behavior outside Babel?

  4. Would the recommended approach today be:

    • importing core-js/actual manually, or
    • using something like @vitejs/plugin-legacy?

Motivation

It would be helpful to have clear best practices or an officially recommended ecosystem approach so that developers don’t accidentally over-polyfill or miss required features.


Thanks again for your work 🙏

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions