vue-loader was used without the corresponding plugin.

为了引入.vue文件,安装完vue-loader和vue-template-compiler后,运行报错:

vue-loader was used without the corresponding plugin.Make sure to include VueLoaderPlugin in your webpack config.

百度了一下,是因为vue-loader,15的版本需要再添加plugin的配置。有两种解决方法:

1.把安装版本改为14的

2.在webpack.config.js中添加:

const { VueLoaderPlugin } = require('vue-loader')

module.exports = {
  // ...
  plugins: [
    new VueLoaderPlugin()
  ]
}

你可能感兴趣的:(vue)