@@ -3,10 +3,21 @@ const id = 'vue-loader-plugin'
33const NS = 'vue-loader'
44const BasicEffectRulePlugin = require ( 'webpack/lib/rules/BasicEffectRulePlugin' )
55const BasicMatcherRulePlugin = require ( 'webpack/lib/rules/BasicMatcherRulePlugin' )
6- const DescriptionDataMatcherRulePlugin = require ( 'webpack/lib/rules/DescriptionDataMatcherRulePlugin' )
76const RuleSetCompiler = require ( 'webpack/lib/rules/RuleSetCompiler' )
87const UseEffectRulePlugin = require ( 'webpack/lib/rules/UseEffectRulePlugin' )
98
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+
1021const ruleSetCompiler = new RuleSetCompiler ( [
1122 new BasicMatcherRulePlugin ( 'test' , 'resource' ) ,
1223 new BasicMatcherRulePlugin ( 'mimetype' ) ,
@@ -20,7 +31,7 @@ const ruleSetCompiler = new RuleSetCompiler([
2031 new BasicMatcherRulePlugin ( 'realResource' ) ,
2132 new BasicMatcherRulePlugin ( 'issuer' ) ,
2233 new BasicMatcherRulePlugin ( 'compiler' ) ,
23- new DescriptionDataMatcherRulePlugin ( ) ,
34+ ... objectMatcherRulePlugins ,
2435 new BasicEffectRulePlugin ( 'type' ) ,
2536 new BasicEffectRulePlugin ( 'sideEffects' ) ,
2637 new BasicEffectRulePlugin ( 'parser' ) ,
0 commit comments