如果遇到:

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 v15现在需要一个附带的webpack插件才能正常工作:
参考资料:
https://vue-loader.vuejs.org/migrating.html#notable-breaking-changes
在这里插入图片描述
配置:

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

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

前往低代码交流专区

更多推荐