Babel 6 regeneratorRuntime is not defined

前端 未结 30 2271
暖寄归人
暖寄归人 2020-11-22 03:49

I\'m trying to use async, await from scratch on Babel 6, but I\'m getting regeneratorRuntime is not defined.

.babelrc file

{
    \"presets\": [ \"es2         


        
30条回答
  •  误落风尘
    2020-11-22 04:10

    For people looking to use the babel-polyfill version 7^ do this with webpack ver3^.

    Npm install the module npm i -D @babel/polyfill

    Then in your webpack file in your entry point do this

    entry: ['@babel/polyfill', path.resolve(APP_DIR, 'App.js')],
    

提交回复
热议问题