Vue-loader: Webpack 5 compatibility: Missing module RuleSet

Created on 14 Oct 2019  路  6Comments  路  Source: vuejs/vue-loader

Version

15.7.1

Reproduction link

https://github.com/Lyrkan/repro-vue-loader-webpack5

Steps to reproduce

  • Create a project that uses Webpack 5 and vue-loader 15.7.1
  • Try to run Webpack

What is expected?

No error

What is actually happening?

Error: Cannot find module 'webpack/lib/RuleSet'


Hi there,

Webpack 5 (that just got into beta) removed the RuleSet class that is currently used by the vue-loader plugin in the following PR: https://github.com/webpack/webpack/pull/9138

This makes any attempt to use the plugin fail with a "Cannot find module webpack/lib/RuleSet" error.

help wanted contribution welcome

Most helpful comment

webpack5 has rewrited the ruleset module, which means the VueLoaderPlugin cannot use class Ruleset any more, instead, it should use the RuleSetCompiler.

here is my pr #1607, there are too many changes in VueLoaderPlugin, I think vue-loader needs a major version update to support webpack5. hope can get you guys attention, thanks

All 6 comments

Any updates?

webpack5 has rewrited the ruleset module, which means the VueLoaderPlugin cannot use class Ruleset any more, instead, it should use the RuleSetCompiler.

here is my pr #1607, there are too many changes in VueLoaderPlugin, I think vue-loader needs a major version update to support webpack5. hope can get you guys attention, thanks

as a workaround, you can use this node package only for webpack5
vue-loader-plugin

@sodatea Hi, I made a new pr according to your suggestions #1613

npm latest version is still 15.7.2, is it not released to npm?

Seems an npm issue, as I've found several similar complaints on Twitter:

It seems to have taken effect after I've published v15.8.1

Was this page helpful?
0 / 5 - 0 ratings