vue加载单文件使用vue-loader报错

Posted mishell

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了vue加载单文件使用vue-loader报错相关的知识,希望对你有一定的参考价值。

报错信息如下:
ERROR in ./src/login.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 7:13-35
解决办法如下:
// webpack.config.js
const VueLoaderPlugin = require(vue-loader/lib/plugin)
module.exports = {
    plugins:[
        new VueLoaderPlugin()
    ],
    module:{
        rules:[
            {test:/.vue/,use:vue-loader},
        ]
    },
}

 

以上是关于vue加载单文件使用vue-loader报错的主要内容,如果未能解决你的问题,请参考以下文章