JetBrains / svg-sprite-loader

Webpack loader for creating SVG sprites.
MIT License
2.01k stars 271 forks source link

fix(utils): fix: some options had no effect with webpack5 #460

Closed KycKyc closed 3 years ago

KycKyc commented 3 years ago

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 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:

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

dcosta-ptc commented 3 years ago

Any news on this PR? :)