Skip to content

Commit 14bfc01

Browse files
committed
fix: avoid mutating original rules array
close #1286
1 parent 0039fb9 commit 14bfc01

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/plugin.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class VueLoaderPlugin {
2626
}
2727

2828
// get a hold of the raw rules
29-
const rawRules = compiler.options.module.rules
29+
const rawRules = compiler.options.module.rules.slice()
3030
// use webpack's RuleSet utility to normalize user rules
3131
const rawNormalizedRules = new RuleSet(rawRules).rules
3232

@@ -127,6 +127,9 @@ class VueLoaderPlugin {
127127
return parsed.vue != null
128128
}
129129
})
130+
131+
// replace original rules
132+
compiler.options.module.rules = rawRules
130133
}
131134
}
132135

0 commit comments

Comments
 (0)