如果遇到 vue-loader was used without the corresponding plugin

如果遇到:

ERROR in ./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/main.js 5:0-31

如果遇到 vue-loader was used without the corresponding plugin_第1张图片
那么你需要安装一个插件
Vue Loader v15现在需要一个附带的webpack插件才能正常工作:
参考资料:
https://vue-loader.vuejs.org/migrating.html#notable-breaking-changes
如果遇到 vue-loader was used without the corresponding plugin_第2张图片
配置:

# 在webpack.config.js中加入
const VueLoaderPlugin = require('vue-loader/lib/plugin')

plugins: [
     
        new VueLoaderPlugin()
    ],
module: { // 用来配置第三方loader模块的
        rules: [ // 文件的匹配规则
            {test: /\.vue$/, use: ['vue-loader']}
        ]
    }

你可能感兴趣的:(如果遇到 vue-loader was used without the corresponding plugin)