File tree 2 files changed +14
-2
lines changed
2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,12 @@ class VueLoaderPlugin {
31
31
// find the rule that applies to vue files
32
32
let vueRuleIndex = rawRules . findIndex ( createMatcher ( `foo.vue` ) )
33
33
if ( vueRuleIndex < 0 ) {
34
- vueRuleIndex = rawRules . findIndex ( createMatcher ( `foo.vue.html` ) )
34
+ const vueHtmlRuleIndex = rawRules . findIndex ( createMatcher ( `foo.vue.html` ) )
35
+ const htmlOnlyRuleIndex = rawRules . findIndex ( createMatcher ( `foo.html` ) )
36
+ // Only use the .vue.html rules if they don't also match normal .html files
37
+ if ( vueHtmlRuleIndex >= 0 && htmlOnlyRuleIndex < 0 ) {
38
+ vueRuleIndex = vueHtmlRuleIndex
39
+ }
35
40
}
36
41
const vueRule = rules [ vueRuleIndex ]
37
42
Original file line number Diff line number Diff line change @@ -60,9 +60,16 @@ class VueLoaderPlugin {
60
60
} )
61
61
62
62
if ( ! vueRules . length ) {
63
- vueRules = ruleSet . exec ( {
63
+ const vueHtmlRules = ruleSet . exec ( {
64
64
resource : 'foo.vue.html'
65
65
} )
66
+ const htmlOnlyRules = ruleSet . exec ( {
67
+ resource : 'foo.html'
68
+ } )
69
+ // Only use the .vue.html rules if they don't also match normal .html files
70
+ if ( vueHtmlRules . length > htmlOnlyRules . length ) {
71
+ vueRules = vueHtmlRules
72
+ }
66
73
}
67
74
if ( vueRules . length > 0 ) {
68
75
if ( rawRule . oneOf ) {
You can’t perform that action at this time.
0 commit comments