. webpack2.4.*集成vue-loader@15.2.4报错

1、报错

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/js/b.js

2、原因

3、解决办法

  • 修改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 : {
    ...
}
}
posted @ 2021-06-03 23:58  .爬行的蜗牛  阅读(96)  评论(0编辑  收藏  举报
Document