-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Explicitly setting targets
does not prevent @vitejs/plugin-legacy
from overriding build.target
#10201
Comments
targets
does not prevent @vitejs/plugin-legacy
from override build.target
targets
does not prevent @vitejs/plugin-legacy
from overriding build.target
Currently it does not make sense to set |
I just want to specify the target of esbuild to It always throws error during building: [vite:esbuild-transpile] Transform failed with 1 error:
assets/index.3e92d52e.js:78:0: ERROR: Top-level await is not available in the configured target environment ("chrome64", "edge79", "es2020", "firefox67", "safari11.1" + 2 overrides) |
Since |
So you are using plugin-legacy to generate only modern polyfills? I think we could avoid pinning the target when If you want to avoid transpiling top-level-await for modern chunk and transpile top-level-await for legacy chunk, this was not working from before. Modern chunk was used for Chrome64+ that includes browsers not supporting top-level-await, but it contained top-level-await as-is. |
Yes.
Agree! By the way, I think if |
Describe the bug
I set
targets
to@vitejs/plugin-legacy
but it still thrown the following warning and overrode thebuild.target
ofvite
Reproduction
https://stackblitz.com/edit/vitejs-vite-jblb6v
System Info
Used Package Manager
pnpm
Logs
Click to expand!
Validations
The text was updated successfully, but these errors were encountered: