webpack vue-loader was used without the corresponding plugin

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

webpack在配置的时候总是报这个错在网上找了很多方法都不行 按照网上的方法配置webpack.config.js修改代码

const VueLoaderPlugin = require('vue-loader/lib/plugin');
module.exports = {
    devtool: "sourcemap",
    entry: './js/entry.js', // 入口文件
    output: {
        filename: 'bundle.js' // 打包出来的wenjian
    },
    plugins: [
        // make sure to include the plugin for the magic
        new VueLoaderPlugin()
    ],
    module : {
    ...
}
}

依然没有解决我遇到的问题,于是就放置了一天,今天重新拾起来一看才发现webpack.config.js配置了两个plugins类似这样

const VueLoaderPlugin = require('vue-loader/lib/plugin');
module.exports = {
    devtool: "sourcemap",
    entry: './js/entry.js', // 入口文件
    plugins: [
        // make sure to include the plugin for the magic
        new VueLoaderPlugin()
    ],
    output: {
        filename: 'bundle.js' // 打包出来的wenjian
    },
    plugins: [
        // make sure to include the plugin for the magic
        new VueLoaderPlugin()
    ],
    module : {
    ...
}
}

将代码中的两个plugins合并到一块问题解决

你可能感兴趣的:(webpack vue-loader was used without the corresponding plugin)