如果你安装完 vue-loader vue-template-compiler 执行 npm run dev 时报错如下:

vue-loader was used without the corresponding plugin. Make sure to include VueLoaderPlugin in your webpack config.
Error: vue-loader was used without the corresponding plugin. Make sure to include VueLoaderPlugin in your webpack config.

有可能是版本问题。

解决方法:

首先安装:

cnpm i vue-loader vue-template-compiler -D

再去webpack.config.js中做相应的配置:

const VueLoaderPlugin = require('vue-loader/lib/plugin')

在plugins 属性下添加:

new VueLoaderPlugin()

 

Logo

Vue社区为您提供最前沿的新闻资讯和知识内容

更多推荐