Skip to content

Commit be9077c

Browse files
committed
fix: add rule plugins to keep up with webpack 5 new features
Reference: https://github.com/webpack/webpack/blob/v5.3.1/lib/NormalModuleFactory.js#L133-L152
1 parent e88dbe9 commit be9077c

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/pluginWebpack5.ts

+7-3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const NS = 'vue-loader'
88
const NormalModule = require('webpack/lib/NormalModule')
99
const BasicEffectRulePlugin = require('webpack/lib/rules/BasicEffectRulePlugin')
1010
const BasicMatcherRulePlugin = require('webpack/lib/rules/BasicMatcherRulePlugin')
11+
const DescriptionDataMatcherRulePlugin = require('webpack/lib/rules/DescriptionDataMatcherRulePlugin')
1112
const UseEffectRulePlugin = require('webpack/lib/rules/UseEffectRulePlugin')
1213
const RuleSetCompiler = require('webpack/lib/rules/RuleSetCompiler') as RuleSetCompiler
1314

@@ -62,20 +63,23 @@ type Effect = BasicEffect | UseEffect
6263

6364
const ruleSetCompiler = new RuleSetCompiler([
6465
new BasicMatcherRulePlugin('test', 'resource'),
66+
new BasicMatcherRulePlugin('mimetype'),
67+
new BasicMatcherRulePlugin('dependency'),
6568
new BasicMatcherRulePlugin('include', 'resource'),
6669
new BasicMatcherRulePlugin('exclude', 'resource', true),
67-
new BasicMatcherRulePlugin('resource'),
6870
new BasicMatcherRulePlugin('conditions'),
71+
new BasicMatcherRulePlugin('resource'),
6972
new BasicMatcherRulePlugin('resourceQuery'),
73+
new BasicMatcherRulePlugin('resourceFragment'),
7074
new BasicMatcherRulePlugin('realResource'),
7175
new BasicMatcherRulePlugin('issuer'),
7276
new BasicMatcherRulePlugin('compiler'),
77+
new DescriptionDataMatcherRulePlugin(),
7378
new BasicEffectRulePlugin('type'),
7479
new BasicEffectRulePlugin('sideEffects'),
7580
new BasicEffectRulePlugin('parser'),
7681
new BasicEffectRulePlugin('resolve'),
77-
new BasicEffectRulePlugin('generator'),
78-
new UseEffectRulePlugin(),
82+
new UseEffectRulePlugin()
7983
])
8084

8185
class VueLoaderPlugin implements Plugin {

0 commit comments

Comments
 (0)