Support for top level async await when using esbuild. #4611
-
Hi there! Currently using sam cli and esbuild combo for a project and would like to make use of top level await for some initialisation work. I've got an example project here - https://github.com/MattBidewell/sam-cli-esbuild-top-level-await Has anyone got this working when using the esbuild and sam cli together? I suspect the issue is because the target is es2020 but I get the same issue when targeting es2022/1 as well. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey @MattBidewell, Thanks for providing an example, made it really quick to reproduce. I was able to getting it working by changing the target to
|
Beta Was this translation helpful? Give feedback.
Hey @MattBidewell,
Thanks for providing an example, made it really quick to reproduce. I was able to getting it working by changing the target to
node16
and changing the format fromcjs
toesm
.