Skip to content

Using Top Level Await with TypeScript #1441

Answered by kdy1
justsharan asked this question in Q&A
Discussion options

You must be logged in to vote

You need to set jsc.target to es2017 or upper.

I verified that the following .swcrc allows top-level awaits.

{
  "jsc": {
    "parser": {
      "syntax": "typescript"
    },
    "target": "es2017"
  }
}

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@justsharan
Comment options

@kdy1
Comment options

kdy1 Feb 28, 2021
Maintainer

Answer selected by kdy1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants