You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a developer using Vite I want to have more control on what options @vitejs/plugin-legacy passes to babel. Currently, the only option that I can control is targets:
I would like to be able to at least pass include to inject additional babel plugins.
Suggested solution
Whatever. It could be an object to be merged with the result of createBabelPresetEnvOptions, or a callback that modifies the options coming from createBabelPresetEnvOptions before they are passed to babel.
Alternative
No response
Additional context
The actual problem I am trying to solve is #13038: the "chrome 49" legacy target yields broken code due to missing additional babel transformations (see here).
Even though this could be an upstream problem in @babel/preset-env, if this kind of customization was possible I would be able to come up with a workaround on Vite level.
Description
As a developer using Vite I want to have more control on what options
@vitejs/plugin-legacy
passes to babel. Currently, the only option that I can control istargets
:vite/packages/plugin-legacy/src/index.ts
Lines 440 to 446 in 447df7c
I would like to be able to at least pass
include
to inject additional babel plugins.Suggested solution
Whatever. It could be an object to be merged with the result of
createBabelPresetEnvOptions
, or a callback that modifies the options coming fromcreateBabelPresetEnvOptions
before they are passed to babel.Alternative
No response
Additional context
The actual problem I am trying to solve is #13038: the "chrome 49" legacy target yields broken code due to missing additional babel transformations (see here).
Even though this could be an upstream problem in
@babel/preset-env
, if this kind of customization was possible I would be able to come up with a workaround on Vite level.Validations
The text was updated successfully, but these errors were encountered: