如果遇到 vue-loader was used without the corresponding plugin
如果遇到:ERROR in ./App.vueModule 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....
·
如果遇到:
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']}
]
}
更多推荐
已为社区贡献5条内容
所有评论(0)