webpack 打包vue的mutations时{...info} 失败
package.js中关于babel的包如下:"babel-core": "^6.0.0","babel-loader": "^6.0.0","babel-plugin-transform-object-rest-spread": "^6.26.0","babel-plugin-transform-runtime": "^6.0.0","babel-plugin-transform-vue-jsx": "^3.5.0","babel-preset-es2015": "^6.0.0","babel-preset-stage-3": "^6.24.1","babel-register": "^6.0.0","babel-runtime": "^6.23.0","webpack": "^3.6.0",
Vue2.x中的mutation.js文件编译出错
解决方案:1.确保不要用babel.config.js而是使用.babelrc2.wepback.base.conf.js中js相关配置如下:{ test: /.js$/, loader: "babel-loader", include: [resolve("src"), resolve("test"), resolve("node_modules/webpack-dev-server/client")]},
- .babelrc文件内容如下:
{ "presets": [
[
"stage-3"
] ], "plugins": [
"transform-runtime"
]}4.注意,一定不要将es2015加到presets中~~ ~~
转载自:https://segmentfault.com/a/1190000039308426