Using async/await with babel - require(“babel-polyfill”) line not at the top in built file

后端 未结 3 1791
予麋鹿
予麋鹿 2021-01-18 11:43

I am trying to use ES2017 async/await syntax with Babel. In package.json, I have

\"babel\": {
    \"plugins\": [
      \"babel-plugin-transform         


        
3条回答
  •  终归单人心
    2021-01-18 12:31

    A different, and probably better solution would be to modularise your code:

    • add an index.js which only exports the stuff you want to export and includes the polyfill
    • add the real functions to small files that only do one thing

提交回复
热议问题