What kind of change does this PR introduce? (bugfix, feature, docs update, improvement)
bugfix
What is the current behavior? (You can also link to an open issue here)ruleSet.exec({resource: '.svg'}) is used to find svg-sprite-loader options object,
but this approach does not work if we define a rule with something like test: /svg-sprites.*?\.svg/
And sometimes we need different loaders for different svg files, like:
svg-sprite-loader for svg icons
file-loader for single big svg files (images)
What is the new behavior (if this is a feature change)?
Will scan all raw rules one by one until it will find svg-sprite-loader, then it will break out of for-loop and will return option object for that rule.
If there is multiple rules (for some reason) it will return option object for the first one, like in the current solution.
ISSUES CLOSED: #446
What kind of change does this PR introduce? (bugfix, feature, docs update, improvement) bugfix
What is the current behavior? (You can also link to an open issue here)
ruleSet.exec({resource: '.svg'})
is used to findsvg-sprite-loader
options object, but this approach does not work if we define a rule with something liketest: /svg-sprites.*?\.svg/
And sometimes we need different loaders for different svg files, like:What is the new behavior (if this is a feature change)? Will scan all raw rules one by one until it will find
svg-sprite-loader
, then it will break out of for-loop and will return option object for that rule. If there is multiple rules (for some reason) it will return option object for the first one, like in the current solution.Does this PR introduce a breaking change? No