@@ -3,10 +3,21 @@ const id = 'vue-loader-plugin'
3
3
const NS = 'vue-loader'
4
4
const BasicEffectRulePlugin = require ( 'webpack/lib/rules/BasicEffectRulePlugin' )
5
5
const BasicMatcherRulePlugin = require ( 'webpack/lib/rules/BasicMatcherRulePlugin' )
6
- const DescriptionDataMatcherRulePlugin = require ( 'webpack/lib/rules/DescriptionDataMatcherRulePlugin' )
7
6
const RuleSetCompiler = require ( 'webpack/lib/rules/RuleSetCompiler' )
8
7
const UseEffectRulePlugin = require ( 'webpack/lib/rules/UseEffectRulePlugin' )
9
8
9
+ const objectMatcherRulePlugins = [ ]
10
+ try {
11
+ const ObjectMatcherRulePlugin = require ( 'webpack/lib/rules/ObjectMatcherRulePlugin' )
12
+ objectMatcherRulePlugins . push (
13
+ new ObjectMatcherRulePlugin ( 'assert' , 'assertions' ) ,
14
+ new ObjectMatcherRulePlugin ( 'descriptionData' )
15
+ )
16
+ } catch ( e ) {
17
+ const DescriptionDataMatcherRulePlugin = require ( 'webpack/lib/rules/DescriptionDataMatcherRulePlugin' )
18
+ objectMatcherRulePlugins . push ( new DescriptionDataMatcherRulePlugin ( ) )
19
+ }
20
+
10
21
const ruleSetCompiler = new RuleSetCompiler ( [
11
22
new BasicMatcherRulePlugin ( 'test' , 'resource' ) ,
12
23
new BasicMatcherRulePlugin ( 'mimetype' ) ,
@@ -20,7 +31,7 @@ const ruleSetCompiler = new RuleSetCompiler([
20
31
new BasicMatcherRulePlugin ( 'realResource' ) ,
21
32
new BasicMatcherRulePlugin ( 'issuer' ) ,
22
33
new BasicMatcherRulePlugin ( 'compiler' ) ,
23
- new DescriptionDataMatcherRulePlugin ( ) ,
34
+ ... objectMatcherRulePlugins ,
24
35
new BasicEffectRulePlugin ( 'type' ) ,
25
36
new BasicEffectRulePlugin ( 'sideEffects' ) ,
26
37
new BasicEffectRulePlugin ( 'parser' ) ,
0 commit comments