Skip to content

Commit

Permalink
fix unit
Browse files Browse the repository at this point in the history
  • Loading branch information
hiyuki committed Nov 30, 2023
1 parent d0b4819 commit 874add2
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions packages/webpack-plugin/lib/platform/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
const runRules = require('./run-rules')
const specMap = {
template: {
wx: require('./template/wx')
},
json: {
wx: require('./json/wx')
}
}

module.exports = function getRulesRunner ({
type,
Expand All @@ -20,7 +12,15 @@ module.exports = function getRulesRunner ({
warn,
error
}) {
const spec = specMap[type] && specMap[type][srcMode] && specMap[type][srcMode]({ warn, error })
const specMap = {
template: {
wx: require('./template/wx')
},
json: {
wx: require('./json/wx')
}
}
const spec = specMap[type]?.[srcMode]?.({ warn, error })
if (spec && spec.supportedModes.indexOf(mode) > -1) {
const normalizeTest = spec.normalizeTest
const mainRules = mainKey ? spec[mainKey] : spec
Expand Down

0 comments on commit 874add2

Please sign in to comment.