@@ -8,10 +8,21 @@ const NS = 'vue-loader'
88const NormalModule = require ( 'webpack/lib/NormalModule' )
99const BasicEffectRulePlugin = require ( 'webpack/lib/rules/BasicEffectRulePlugin' )
1010const BasicMatcherRulePlugin = require ( 'webpack/lib/rules/BasicMatcherRulePlugin' )
11- const DescriptionDataMatcherRulePlugin = require ( 'webpack/lib/rules/DescriptionDataMatcherRulePlugin' )
1211const UseEffectRulePlugin = require ( 'webpack/lib/rules/UseEffectRulePlugin' )
1312const RuleSetCompiler = require ( 'webpack/lib/rules/RuleSetCompiler' ) as RuleSetCompiler
1413
14+ let objectMatcherRulePlugins = [ ]
15+ try {
16+ const ObjectMatcherRulePlugin = require ( 'webpack/lib/rules/ObjectMatcherRulePlugin' )
17+ objectMatcherRulePlugins . push (
18+ new ObjectMatcherRulePlugin ( 'assert' , 'assertions' ) ,
19+ new ObjectMatcherRulePlugin ( 'descriptionData' )
20+ )
21+ } catch ( e ) {
22+ const DescriptionDataMatcherRulePlugin = require ( 'webpack/lib/rules/DescriptionDataMatcherRulePlugin' )
23+ objectMatcherRulePlugins . push ( new DescriptionDataMatcherRulePlugin ( ) )
24+ }
25+
1526type RawRule = RuleSetRule
1627
1728// webpack 5 doesn't export the internal Rule types so we have to shim it here
@@ -74,7 +85,7 @@ const ruleSetCompiler = new RuleSetCompiler([
7485 new BasicMatcherRulePlugin ( 'realResource' ) ,
7586 new BasicMatcherRulePlugin ( 'issuer' ) ,
7687 new BasicMatcherRulePlugin ( 'compiler' ) ,
77- new DescriptionDataMatcherRulePlugin ( ) ,
88+ ... objectMatcherRulePlugins ,
7889 new BasicEffectRulePlugin ( 'type' ) ,
7990 new BasicEffectRulePlugin ( 'sideEffects' ) ,
8091 new BasicEffectRulePlugin ( 'parser' ) ,
0 commit comments