带Laravel的Vue-strap:模块构建失败

时间:2016-10-10 06:05:36

标签: laravel vue.js vue-strap

我不确定Vue-strap是否适用于2.0,因此我想尝试使用其Navbar组件。

我在app.js中添加了这个。

Vue.component('navbar', require('../../../node_modules/vue-strap/src/Navbar.vue'));

gulp watch会抛出此错误。

ERROR in ./~/vue-strap/src/utils/NodeList.js
Module build failed: Error
  at ForOfStatement.initialise (/var/www/web_redeem/node_modules/buble/dist/buble.umd.js:2004:65)
at /var/www/web_redeem/node_modules/buble/dist/buble.umd.js:9381:56
at Array.forEach (native)
at BlockStatement.initialise (/var/www/web_redeem/node_modules/buble/dist/buble.umd.js:9381:15)
at FunctionDeclaration.initialise (/var/www/web_redeem/node_modules/buble/dist/buble.umd.js:858:12)
at FunctionDeclaration.initialise (/var/www/web_redeem/node_modules/buble/dist/buble.umd.js:2071:31)
at /var/www/web_redeem/node_modules/buble/dist/buble.umd.js:9381:56
at Array.forEach (native)
at BlockStatement.initialise (/var/www/web_redeem/node_modules/buble/dist/buble.umd.js:9381:15)
@ ./~/buble-loader!./~/vue-loader/lib/selector.js?type=script&index=0!./~/vue-strap/src/Navbar.vue 33:0-35
@ ./~/vue-strap/src/Navbar.vue
@ ./resources/assets/js/app.js

1 个答案:

答案 0 :(得分:0)

Elixir用不支持for ... of语句的Bublé编译js。考虑切换到巴贝尔。

如果您使用https://github.com/vuejs/laravel-elixir-vue-2更改为https://github.com/JeffreyWay/laravel-elixir-vue