lucacasonato / esbuild_deno_loader

Deno module resolution for `esbuild`
https://deno.land/x/esbuild_deno_loader
MIT License
160 stars 43 forks source link

Top-level await is disallowed in service workers. #123

Closed mfulton26 closed 5 months ago

mfulton26 commented 5 months ago

Can querySync be used instead of query (async) so that this loader can be used in service worker (or service worker like) environments?

https://github.com/lucacasonato/esbuild_deno_loader/blob/ccd8992c690deee821d6b7a7efeaf599722c394c/src/plugin_deno_loader.ts#L79-L84

mfulton26 commented 5 months ago

Or have some other way to avoid a top-level await call.

mfulton26 commented 5 months ago

In retrospect, I don't want to bundle the esbuild loading code into my service worker so I'll need to decouple the code in fresh that imports this loader from the router logic being bundled for an offline web app powered by Fresh routing, etc. in a service worker.