vuejs-templates / webpack-simple

A simple Webpack + vue-loader setup for quick prototyping.
2.27k stars 894 forks source link

...mapState from vuex not working #157

Closed ianengelbrecht closed 6 years ago

ianengelbrecht commented 6 years ago

It seems as though the webpack config doesn't support the object spread operator. I had to reinstall devDependencies, and update .babelrc to the following:

{ "presets": [ ["es2015", { "modules": false, "loose": true}], ["stage-2"] ], "plugins": [ ["transform-runtime"], ["transform-object-rest-spread"], ["transform-es2015-destructuring"] ] }

However, now I get this error on compilation:

__webpack_require__(...) is not a function.

It would be fantastic if this template could support vuex's ...mapState out of the box, rather than having to the move to the full webpack template.

LinusBorg commented 6 years ago

That's been fixed, you seem to run on an older version of the template, we added babel-preset-stage-3 5 months ago, which includes babel-transform-object-rest-spread.