surma / rollup-plugin-comlink

Use workers seamlessly with Rollup
https://www.npmjs.com/package/@surma/rollup-plugin-comlink
Apache License 2.0
38 stars 2 forks source link

Drop OMT dependency by using this.emitFile? #2

Closed eight04 closed 3 years ago

eight04 commented 3 years ago

Is it possible to drop OMT dependency by emitting the wrapper chunk via this.emitFile and reference the path using import.meta.ROLLUP_FILE_referenceId?

https://rollupjs.org/guide/en/#thisemitfileemittedfile-emittedchunk--emittedasset--string

surma commented 3 years ago

Not yet, sadly. The OMT plugin is necessary for as long as we don’t have full support for module workers in every browser as OMT injects a tiny AMD loader. Once browsers have caught up, the entire OMT plugin will become pretty much obsolete (and I can’t wait!).