Skip to content

happypack配合vue-loader使用报错 #1573

@ddmy

Description

@ddmy

webpack版本: ^4.16.3
vue-loader: ^15.3.0
happypack: ^5.0.1

webpack.config.js 部分配置信息

const VueLoaderPlugin = require('vue-loader/lib/plugin')
const HappyPack = require('happypack')

loaders.push(
  {
    test: /\.vue$/,
    loader: 'happypack/loader?id=vue'
  }
)

const plugins = [
    new VueLoaderPlugin(),
    new HappyPack({
      id: 'vue',
      loaders: ['vue-loader']
    })
]

config.module.rules = loaders
config.plugins = plugins

module.exports = config

打包报错信息

Error: [VueLoaderPlugin Error] No matching use for vue-loader is found.
Make sure the rule matching .vue files include vue-loader in its use.

我想问一下这是跟vue-loader版本有关系?为什么呢?该如何解决呢?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions