Why isn't Vite target: 'esnext' used by default?
#1896
Replies: 2 comments 1 reply
-
|
The AI chatbot tried to answer this question, but really didn't provide a satisfactory reason:
So I guess it's to make sure really old browsers are targeted maybe? This Vite might be something to add to the docs. And wouldn't you know it, when I asked the AI chatbot, it actually said:
🤦♂️ These AI chatbots are getting a little too well-trained. 😬 |
Beta Was this translation helpful? Give feedback.
-
|
Top-level Besides even if I take out the top-level
So maybe I'll just back out of all these |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I had a problem trying to use a top-level
awaitin the background script. The helpful AI chatbot told me I need to switch from IIFE modules to ES modules. (I was curious as to why I wasn't using modern modules already, and the AI chatbot told me it was because MV2 doesn't support them, and by default Firefox is configured to use MV2.)I followed the AI chatbot directions and added
type: "module"to my background script. That led me to another error:The AI chatbot told me the next steps of adding
esnexthere and there. I looked and./.wxt/tsconfig.jsonis already configured foresnext:What was missing was the Vite configuration; again following the AI chatbot recommendation, I added the following to
wxt.config.ts:So the question is: Why doesn't WXT configure Vite to use
esnextby default, since./.wxt/tsconfig.jsonapparently is defaulting toesnext?Beta Was this translation helpful? Give feedback.
All reactions