Skip to content

Commit

Permalink
feat: support declaring rules using .vue.html (ref #1238)
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Apr 13, 2018
1 parent a029f77 commit a3af6b3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@ module.exports = class VueLoaderPlugin {
const clone = Object.assign({}, rule)
delete clone.include
const normalized = RuleSet.normalizeRule(clone, {}, '')
return !rule.enforce && normalized.resource && normalized.resource(`foo.vue`)
return !rule.enforce && normalized.resource && (
normalized.resource(`foo.vue`) ||
normalized.resource(`foo.vue.html`)
)
})
const vueRule = rawRules[vueRuleIndex]

if (!vueRule) {
throw new Error(
`[VueLoaderPlugin Error] No matching rule for .vue files found.\n` +
`Make sure there is at least one root-level rule that matches .vue files.`
`Make sure there is at least one root-level rule that matches .vue or .vue.html files.`
)
}

Expand Down

0 comments on commit a3af6b3

Please sign in to comment.