StarkShang / vite-plugin-chrome-extension

A vite plugin to bundle chrome extensions for Manifest V3.
MIT License
460 stars 68 forks source link

Disable IIFE #19

Closed steinybot closed 2 years ago

steinybot commented 2 years ago

Fixes #17

steinybot commented 2 years ago

This is probably unnecessary. We can just add to the window object instead.

Would be nice if there was a way to assign the result of the IIFE to a global variable but AFAIK there is no way to do that with rollup.

thopiddock commented 2 years ago

I would recommend opening this again as the IIFE destroys MV3 event handlers on background service workers that must be at the top level of the file.

I'd find these changes very useful!