Syntax Error:Unexpected token(203,8)
1. npm install babel-plugin-transform-object-rest-spread
2. 在根目录配置.babelrc
文件识别es6语法
{
"presets": [
["env", {
"modules": false,
"targets": {
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
}
}],
"stage-2"
],
"presets": [
["es2015", { "modules": false }]
],
"plugins": ["transform-object-rest-spread"]
}
3. npm install babel-preset-es2015 --save-dev
来源:CSDN
作者:么心么肺
链接:https://blog.csdn.net/weixin_41545048/article/details/103484929