为了账号安全,请及时绑定邮箱和手机立即绑定

gulp-babel编译之后运行async报regeneratorRuntime is not definedulp

gulp-babel编译之后运行async报regeneratorRuntime is not definedulp

千万里不及你 2019-05-14 11:21:59
网上找了很多方法,装了插件还是不行babel-plugin-transform-runtimebabel-runtime.babelrc如下{"presets":["es2015","stage-3"],"plugins":[["transform-runtime",{"helpers":false,"polyfill":false,"regenerator":true,"moduleName":"babel-runtime"}]]}这是开发依赖"devDependencies":{"babel-core":"^6.26.3","babel-plugin-transform-runtime":"^6.23.0","babel-polyfill":"^6.26.0","babel-preset-es2015":"^6.24.1","babel-preset-latest":"^6.24.1","babel-preset-stage-3":"^6.24.1","del":"^3.0.0","eslint":"^4.11.0","express":"^4.16.2","gulp":"^3.9.1","gulp-autoprefixer":"^4.0.0","gulp-awaitable-tasks":"^1.0.0","gulp-babel":"^7.0.1","gulp-changed":"^3.2.0","gulp-concat":"^2.6.1","gulp-eslint":"^4.0.0","gulp-if":"^2.0.2","gulp-less":"^3.3.2","gulp-minify-css":"^1.2.4","gulp-sourcemaps":"^2.6.1","gulp-uglify":"^3.0.0","gulp.spritesmith":"^6.7.0","http-proxy-middleware":"^0.17.4","opn":"^5.1.0","through2":"^2.0.3","babel-runtime":"^6.26.0"},
查看完整描述

2 回答

?
慕标琳琳

TA贡献1830条经验 获得超9个赞

是否有按照官方的要求安装插件:
npminstall--save-devbabel-plugin-transform-runtime
npminstall--savebabel-runtime
如果babel-runtime已经被放到devDependencies,那么先uninstall再install一遍。
                            
查看完整回答
反对 回复 2019-05-14
?
慕田峪7331174

TA贡献1828条经验 获得超13个赞

babel最新版的更新为"presets":["env"],照着这个来吧。安装依赖也比较方便。
npminstallbabel-preset-env--save-dev
                            
查看完整回答
反对 回复 2019-05-14
  • 2 回答
  • 0 关注
  • 1184 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信