Open littledivy opened 4 years ago
As far as I can see, esbuild is not supporting this feature, because it's not compatible with commonjs. Since elsa doesn't use commonjs, wouldn't it make sense to just fork esbuild and code top level await support ourselves?
Not that easy, esbuild does support top level await at transformation but does not support it while bundling. The author of esbuild did express that they need for top level await will arise -https://github.com/evanw/esbuild/issues/253#issuecomment-657359939
Not that easy, esbuild does support top level await at transformation but does not support it while bundling. The author of esbuild did express that they need for top level await will arise -evanw/esbuild#253 (comment)
I tried to do TLA on my own but it is not that easy, for that reason check in esbuild, we tend to wait for them to add TLA suppor
Tracking issue for support for top level await - because, why not? :)
PS: This will be a bundling step (esbuild) rather than runtime
Waiting for esbuild to support top level await for bundling - https://github.com/evanw/esbuild/issues/253