Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

element-iu 项目打包 报错 token keyword ?function?, expected punc ?,?

请老手们帮忙看看这个如何解决?

image.png
通过错误提示查找对应文件的代码,发现使用了 async 导致无法打包,去掉 async 的函数就没有报错,但是这里必须使用 async

image.png

项目结构:

image.png

package.json里的相关版本

image.png

webpack.config.js

image.png

.babelrc

image.png


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
  1. 2020年了,不要用 es2015 了
  2. babel 版本也 7 很久了
  3. 直接整个依赖升级吧,应该可解
npm i @babel/core @babel/preset-env

以此类推


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...