Does Vite Use Babel Instead of esbuild for All Chunks (Including Modern Chunks) When Using @vitejs/plugin-legacy? #19337
Unanswered
zangbianxuegu
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When using @vitejs/plugin-legacy without setting modernTargets, the default modern targets are 'edge>=79, firefox>=67, chrome>=64, safari>=12, chromeAndroid>=64, iOS>=12'. If vite build target is set to es2015, does the syntax transformation of modern chunks follow es2015 or the default modernTargets?
For example, with esbuild targeting es2015, object spread syntax ({ ...obj }) is transformed, but if targeting chrome64, it remains unchanged. When using plugin-legacy, does Vite switch to Babel for all chunk transformations, including modern chunks, instead of using esbuild?
Beta Was this translation helpful? Give feedback.
All reactions