Transpile Async Await proposal with Babel.js?

前端 未结 5 690
耶瑟儿~
耶瑟儿~ 2020-11-30 21:08

There is a proposal for introducing C# style async-await. I know Babel.js transpiles ES6 to ES5, but is there any way to make it transpile async-await to

5条回答
  •  甜味超标
    2020-11-30 21:48

    This solution may have changed since (Feb 25 Felix Kling) or perhaps there is still more than one way to use async await.

    What worked for us was to run Babel like so

    $ npm install babel-runtime
    

    $ babel inputES7.js -o outputES5.js --optional runtime
    

提交回复
热议问题