I am using webpack within a Laravel Mix project. When my webpack.config.js looks like this, Webpack works without error:
module.exports = {
module: {
rules: [{ test: /\.vue$/, loader: 'vue-loader' }]
}
}
But when I add VueLoaderPlugin like so:
const VueLoaderPlugin = require('vue-loader/lib/plugin');
module.exports = {
module: {
rules: [{ test: /\.vue$/, loader: 'vue-loader' }]
},
plugins: [
// make sure to include the plugin for the magic
new VueLoaderPlugin()
]
}
I get this error:
Error: [VueLoaderPlugin Error] No matching use for vue-loader is found.
Make sure the rule matching .vue files include vue-loader in its use.
Which doesn't make sense since I ready have a .vue rule that includes vue-loader. What is the problem here, and how do I resolve it?
https://vue-loader.vuejs.org/guide/#manual-setupthe main difference is to import/requirevue-loaderitself notvue-loader/lib/plugin