-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
feat: use esbuild supported feature #8665
Conversation
rollup supports top-level await (rollup/rollup#2235, rollup/rollup#3089) bundling from 1.29.0. |
I think this test needs to set vite/playground/lib/src/main.js Lines 2 to 3 in 60721ac
vite/playground/lib/__tests__/lib.spec.ts Lines 15 to 27 in 60721ac
|
Since esbuild is seemingly used for SSR now, shouldn't this list be configured for the node version for SSR? Also ideally wouldn't this pick up on a browserslist config for the default env and do something like: https://github.com/nihalgonsalves/esbuild-plugin-browserslist |
✅ Deploy Preview for vite-docs-main ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Thanks for the explanation re
The code change here would affect both browser and SSR, so I think it would cover your usecase too.
Not sure if Vite would ever have first-class browserslist support, but currently we're setting our own baseline |
Sorry I thought rollup removes top-level await after bundle but I noticed that I overlooked the preserved Thanks for fixing the test! |
Description
Use
esbuild
supported
feature to explicitly enable "dynamic imports" and "import.meta" as supported features, regardless oftarget
as Vite handles them.This correctly fixes #5270 in case the user set a lower
build.target
version.Additional context
Let me know if there's more supported features that I've missed 😬
In the second commit, I made an optimization to use
modules
target for dev optimizer, instead ofbuild.target
. This was changed in the past at #5095, but we discussed that it may be better to not rely onbuild.target
in dev as it's not necessary to down-level them like in prod.I'm also open to discussion on this part.
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).