#What's happening under the hood? (Top level await question)

1 messages · Page 1 of 1 (latest)

vital mulch
#

Hi, I'm trying to use a top level await in a module in a project I'm building with Vite and it fails. Using .then() works OK.
As I understand it, top level await only works in modules. When working in Vite in development mode, (npm run dev) are my module files compiled into a module-less format?

patent laurel
vital mulch
#

That's really useful, thanks. What target is used for dev if the entry point is a js file rather than a ts one?