码迷,mamicode.com
首页 > Web开发 > 详细

webpack vue-loader was used without the corresponding plugin. Make sure to include VueLoaderPlugin

时间:2018-12-01 21:47:52      阅读:808      评论:0      收藏:0      [点我收藏+]

标签:解决   一个   without   div   配置   ade   技术分享   filename   template   

当我们出现以下报错!

技术分享图片

解决方案:

// webpack配置文件 

const path = require(‘path‘);

const htmlWebpackPlugin = require(‘html-webpack-plugin‘);

const VueLoaderPlugin = require(‘vue-loader/lib/plugin‘); //引入这行


module.exports = {
    mode:‘none‘,
    entry:‘./src/main.js‘,
    output:{
        path:path.join(__dirname,‘./dist‘),
        filename:‘bundle.js‘
    },
    plugins:[
        new htmlWebpackPlugin({
            template:path.join(__dirname,‘./src/index.html‘),
            filename:‘index.html‘
        }),
         new VueLoaderPlugin() //new一个实例
    ],
    module:{
        rules:[
            {test:/\.css$/,use:[‘style-loader‘,‘css-loader‘]},
            {test:/\.less$/,use:[‘style-loader‘,‘css-loader‘,‘less-loader‘]},
            {test:/\.(jpg|png|bmp|gif|jpeg)$/,use:‘url-loader‘},
            {test:/\.js$/,use:‘babel-loader‘,exclude:/node_modules/},
            {test:/\.vue$/,use:‘vue-loader‘}
        ]
    },
    resolve:{
        alias:{
            ‘vue$‘:‘vue/dist/vue.js‘
        }
    }
}

 

webpack vue-loader was used without the corresponding plugin. Make sure to include VueLoaderPlugin

标签:解决   一个   without   div   配置   ade   技术分享   filename   template   

原文地址:https://www.cnblogs.com/yaogengzhu/p/10050823.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!