Skip to content

Commit

Permalink
fix: avoid mutating original rules array
Browse files Browse the repository at this point in the history
close #1286
  • Loading branch information
yyx990803 committed May 4, 2018
1 parent 0039fb9 commit 14bfc01
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class VueLoaderPlugin {
}

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

Expand Down Expand Up @@ -127,6 +127,9 @@ class VueLoaderPlugin {
return parsed.vue != null
}
})

// replace original rules
compiler.options.module.rules = rawRules
}
}

Expand Down

0 comments on commit 14bfc01

Please sign in to comment.