关于Laravel5.4 Vuejs编译失败的问题处理
Laravel  /  管理员 发布于 5年前   422
下面由laravel教程栏目给大家介绍关于Laravel5.4 Vuejs编译失败的问题处理方法,希望对需要的朋友有所帮助!

在使用Laravel5.4 进行vuejs组件化测试时,出现了这样的错误:
vagrant@homestead:~/Code/zhihu-app$ gulp[00:35:03] Using gulpfile ~/Code/zhihu-app/gulpfile.js[00:35:03] Starting 'all'...[00:35:03] Starting 'sass'...[00:35:09] Finished 'sass' after 5.74 s[00:35:09] Starting 'webpack'...{ [Error: ./resources/assets/js/components/Example.vueModule parse failed: /home/vagrant/Code/zhihu-app/resources/assets/js/components/Example.vue Unexpected token (1:0)You may need an appropriate loader to handle this file type.| <template>| <div class="container">| <div class="row"> @ ./resources/assets/js/app.js 17:26-61] message: './resources/assets/js/components/Example.vue\nModule parse failed: /home/vagrant/Code/zhihu-app/resources/assets/js/components/Example.vue Unexpected token (1:0)\nYou may need an appropriate loader to handle this file type.\n| <template>\n| <div class="container">\n| <div class="row">\n @ ./resources/assets/js/app.js 17:26-61', showStack: false, showProperties: true, plugin: 'webpack-stream', __safety: { toString: [Function: bound ] } }从抛出的错误我们可以看到,是未引入 'laravel-elixir-vue-2',
所以,我们需要下载相应的包,然后引入到gulpfile.js文件中。
var elixir = require('laravel-elixir');require('laravel-elixir-vue-2');// recommended for vue 2elixir(function(mix) { mix.sass('app.scss') .webpack('app.js'); mix.version(['js/app.js', 'css/app.css'])});如果出现Error: Cannot find module 'laravel-elixir-vue-2'错误,则需要下载laravel-elixir-vue-2:
npm install laravel-elixir-vue-2 --save-dev
有关详情,请看GitHub laravel-elixir-vue-2(https://github.com/vuejs/laravel-elixir-vue-2)包用法
以上就是关于Laravel5.4 Vuejs编译失败的问题处理的详细内容,更多请关注其它相关文章!
test1 在
opencode + Oh-my-openagent,我的第一个免费的ai编程智能体管家:Sisyphus中评论 test..122 在
学历:一种延缓就业设计,生活需求下的权衡之选中评论 工作几年后,报名考研了,到现在还没认真学习备考,迷茫中。作为一名北漂互联网打工人..Zita 在
Google AI Studio升级全栈 vibe coding体验,可直接构建带登录和数据库的应用中评论 111222..123 在
Clash for Windows作者删库跑路了,github已404中评论 按理说只要你在国内,所有的流量进出都在监控范围内,不管你怎么隐藏也没用,想搞你分..原梓番博客 在
在Laravel框架中使用模型Model分表最简单的方法中评论 好久好久都没看友情链接申请了,今天刚看,已经添加。..
Copyright·© 2019 侯体宗版权所有·
粤ICP备20027696号
