DEV Community

Dan-k391
Dan-k391

Posted on

After enabling topLevelAwait in webpack and built in production mode what is the easiest way to import?

After enabling topLevelAwait in webpack and built in production mode what is the easiest way to import?

For example, I currently have to use code like

import * as p from "xxx"

let module
p.then((f) => module = f)

module.xxx
Enter fullscreen mode Exit fullscreen mode

in order to import. There has to be a better way of doing this

Top comments (0)