Vue高版本(15.x)报错Make sure to include VueLoaderPlugin

ERROR in ./src/vue/App.vue
Module Error (from ./node_modules/vue-loader/lib/index.js):
vue-loader was used without the corresponding plugin. Make sure to include VueLoaderPlugin in your webpack config.
 @ ./src/main.js 11:0-32 16:9-12

ERROR in ./src/vue/App.vue?vue&type=style&index=0&id=5e019a2f&scoped=true&lang=css&
20:0
Module parse failed: Unexpected token (20:0)
File was processed with these loaders:
 * ./node_modules/vue-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| 
| 
> .title{
|     color:green;
| }
 @ ./src/vue/App.vue 4:0-87
 @ ./src/main.js

ERROR in ./src/vue/App.vue?vue&type=template&id=5e019a2f&scoped=true& 2:0
Module parse failed: Unexpected token (2:0)
File was processed with these loaders:
 * ./node_modules/vue-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| 
> <div id="app">
|         <h2>{{message}}</h2>  
|     </div>
 @ ./src/vue/App.vue 1:0-94 11:2-8 12:2-17
 @ ./src/main.js
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! mettingwebpack@1.0.0 build: `webpack --mode development`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the mettingwebpack@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\software\node\node_cache\_logs\2020-02-05T15_27_05_431Z-debug.log


解决方法
. 在webpack.config.js中加入

const VueLoaderPlugin = require('vue-loader/lib/plugin');
module.exports = {
    plugins: [
        // make sure to include the plugin for the magic
        new VueLoaderPlugin()
    ],
    module : {
    ...
    }
}

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

我啥都会

如果觉得对您有帮助,打赏一下吧

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值