Skip to content

Commit

Permalink
chore: fix ts error
Browse files Browse the repository at this point in the history
  • Loading branch information
Jinjiang committed Jan 11, 2024
1 parent 68d2b3b commit 4b2e9ca
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/pluginWebpack5.ts
Expand Up @@ -13,7 +13,8 @@ const NormalModule = require('webpack/lib/NormalModule')
const BasicEffectRulePlugin = require('webpack/lib/rules/BasicEffectRulePlugin')
const BasicMatcherRulePlugin = require('webpack/lib/rules/BasicMatcherRulePlugin')
const UseEffectRulePlugin = require('webpack/lib/rules/UseEffectRulePlugin')
const RuleSetCompiler = require('webpack/lib/rules/RuleSetCompiler') as RuleSetCompiler
const RuleSetCompiler =
require('webpack/lib/rules/RuleSetCompiler') as RuleSetCompiler

let objectMatcherRulePlugins = []
try {
Expand Down Expand Up @@ -240,7 +241,7 @@ class VueLoaderPlugin {
if (typeof use === 'string') {
loaderString = use
} else if (Array.isArray(use)) {
loaderString = matchOnce(use[0])
loaderString = matchOnce(use[0] as RuleSetUse)
} else if (typeof use === 'object' && use.loader) {
loaderString = use.loader
}
Expand Down Expand Up @@ -302,7 +303,7 @@ class VueLoaderPlugin {
}
}
}
for (const file of compiler.removedFiles) {
for (const file of compiler.removedFiles!) {
vueCompiler.invalidateTypeCache(file)
}
})
Expand Down Expand Up @@ -410,13 +411,13 @@ function cloneRule(

if (rawRule.rules) {
res.rules = rawRule.rules.map((rule) =>
cloneRule(rule, refs, ruleCheck, ruleResource)
cloneRule(rule as RuleSetRule, refs, ruleCheck, ruleResource)
)
}

if (rawRule.oneOf) {
res.oneOf = rawRule.oneOf.map((rule) =>
cloneRule(rule, refs, ruleCheck, ruleResource)
cloneRule(rule as RuleSetRule, refs, ruleCheck, ruleResource)
)
}

Expand Down

0 comments on commit 4b2e9ca

Please sign in to comment.