surma/rollup-plugin-off-main-thread

Configuration for main thread code to be ESM while worker is in AMD?

benjamind opened this issue · 1 comments

I've been trying to figure out if its possible for us to configure a rollup build that would deliver all the main thread bundles using ESM format, while the worker code is bundled internally with AMD?

Since most reasonable target browsers now support ESM for main thread scripts, it would be nice to get the reduced bundle size of no loaders in the main thread while still getting cross browser support for worker bundles.

surma commented

(Only 1 year later.... apologies!)

That will break once a dependency is shared between main-thread and worker, so I don’t think that’s possible. THat being said, we seem to be fairly close to module support across browsers and then we can retire this entire plugin 🎉