Menci / vite-plugin-top-level-await

Transform code to support top-level await in normal browsers for Vite.
MIT License
272 stars 15 forks source link

How to use in vite dev mode with chrome extension service-worker #57

Open mp3por opened 2 months ago

mp3por commented 2 months ago

Hello,

I have this code: https://github.com/mp3por/vite-plugin-top-level-await-worker-issue

when I run it with npm run dev and import the dist folder in brave extension I get the attached error.

From your documentation I could see there is something I could do about 'workers' but I could not get it to work.

If I run npm run build it works. I am trying to use this plugin with this one https://crxjs.dev/vite-plugin for HMR

Please help.

image