mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[GH-ISSUE #774] Support experimental.swcEnvOptions config option #170
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#170
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @github-actions[bot] on GitHub (Apr 4, 2026).
Original GitHub issue: https://github.com/cloudflare/vinext/issues/774
Next.js Change
Next.js added a new
experimental.swcEnvOptionsconfig option that exposes SWC's preset-env configuration for automatic polyfill injection (core-jsusage/entrymode).Commit:
2bf38b0PR: #92272
Config Shape
Impact on vinext
vinext uses Vite for transforms, not SWC's webpack loader, so the polyfill injection behavior itself doesn't directly apply. However:
next.config.jsand rejects unknown keys underexperimental, users with this option will get errors. vinext should accept (and ignore) this key.swcEnvOptionsfor automatic core-js polyfills will lose that functionality on vinext. We should document this gap or explore a Vite-compatible equivalent (e.g., a Vite plugin for core-js injection based on browserslist targets).Suggested Action
experimental.swcEnvOptionsin config without erroringvite-plugin-babelwith@babel/preset-envor a dedicated polyfill plugin)