npm install babel
npm install babel-cli
只需要在安装个plugin .
https://babeljs.io/docs/en/babel-plugin-proposal-object-rest-spread
npm install babel-plugin-transform-object-rest-spread
在.babelrc 文件配置plugins里添加'transform-object-rest-spread'
{
"presets": [
"es2015"
],
"plugins": ["transform-object-rest-spread"]
}
OK,解决了。