@@ -8,10 +8,21 @@ const NS = 'vue-loader'
8
8
const NormalModule = require ( 'webpack/lib/NormalModule' )
9
9
const BasicEffectRulePlugin = require ( 'webpack/lib/rules/BasicEffectRulePlugin' )
10
10
const BasicMatcherRulePlugin = require ( 'webpack/lib/rules/BasicMatcherRulePlugin' )
11
- const DescriptionDataMatcherRulePlugin = require ( 'webpack/lib/rules/DescriptionDataMatcherRulePlugin' )
12
11
const UseEffectRulePlugin = require ( 'webpack/lib/rules/UseEffectRulePlugin' )
13
12
const RuleSetCompiler = require ( 'webpack/lib/rules/RuleSetCompiler' ) as RuleSetCompiler
14
13
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
+
15
26
type RawRule = RuleSetRule
16
27
17
28
// webpack 5 doesn't export the internal Rule types so we have to shim it here
@@ -74,7 +85,7 @@ const ruleSetCompiler = new RuleSetCompiler([
74
85
new BasicMatcherRulePlugin ( 'realResource' ) ,
75
86
new BasicMatcherRulePlugin ( 'issuer' ) ,
76
87
new BasicMatcherRulePlugin ( 'compiler' ) ,
77
- new DescriptionDataMatcherRulePlugin ( ) ,
88
+ ... objectMatcherRulePlugins ,
78
89
new BasicEffectRulePlugin ( 'type' ) ,
79
90
new BasicEffectRulePlugin ( 'sideEffects' ) ,
80
91
new BasicEffectRulePlugin ( 'parser' ) ,
0 commit comments