Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Jun 21, 2021

Conversation

KycKyc
Copy link
Contributor

@KycKyc KycKyc commented Jun 5, 2021

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:

  • 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.

Does this PR introduce a breaking change?
No

ruleSet.exec({resource: '.svg'})` was 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/`

ISSUES CLOSED: JetBrains#446
@dcosta-ptc
Copy link

Any news on this PR? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Webpack 5 with svg-sprite-loader@6.0.2, some options (spriteFilename, outputPath, publicPath) have no effect
3 participants