How to use WASM with a worker?

The Use from JavaScript section of this page suggests to place an await at the top level of a js file:
https://developers.cloudflare.com/workers/runtime-apis/webassembly/javascript/#use-from-javascript
However, when I try to do this with my project, I get an error like this:
ERROR: Top-level await is currently not supported with the "iife" output format

Does anyone know what I can try for this?
Cloudflare Docs
Wasm can be used from within a Worker written in JavaScript or TypeScript by importing a Wasm module, and instantiating an instance of this module
Was this page helpful?