aklinker1 / webext-core

Collection of essential libraries and tools for building web extensions
https://webext-core.aklinker1.io
MIT License
116 stars 13 forks source link

Proxy service not code-splitable #44

Open aklinker1 opened 11 months ago

aklinker1 commented 11 months ago

For example, the this service imports minimatch to use it in the real implementation, but minimatch is included in the final bundle in all entrypoints, not just the background.

Screenshot 2023-10-30 at 8 11 52 PM

Unfortunately, I can't think of a way to accomplish tree shaking without putting the real service and proxy service in a separate file. The more services you have, the more annoying it would be... Just lots of extra files in a project.

Maybe an alternative package, like @webext-core/background-api could be used to group all services under a single object.