Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customize @vitejs/plugin-legacy babel options #13039

Closed
4 tasks done
IlyaSemenov opened this issue Apr 28, 2023 · 1 comment
Closed
4 tasks done

Customize @vitejs/plugin-legacy babel options #13039

IlyaSemenov opened this issue Apr 28, 2023 · 1 comment

Comments

@IlyaSemenov
Copy link
Contributor

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 is targets:

[
'@babel/preset-env',
createBabelPresetEnvOptions(targets, {
needPolyfills,
ignoreBrowserslistConfig: options.ignoreBrowserslistConfig,
}),
],

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.

Validations

@sapphi-red
Copy link
Member

Closing as the actual problem is seems to be already fixed. If other users have a concrete use case for this, feel free to create a new issue.

@sapphi-red sapphi-red closed this as not planned Won't fix, can't repro, duplicate, stale Mar 17, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Apr 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants