babel es6转es5时候不支持扩展符... 解决方案

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,解决了。

你可能感兴趣的:(babel es6转es5时候不支持扩展符... 解决方案)