Closed Judahmeek closed 3 months ago
Is this something really worth shipping to everyone that uses Shakapacker? I think it's worth documenting but all the other utils are used somewhere from what I can tell...
Keeping in mind once shipped it'll be something we have to maintain and do a new major to remove.
@G-Rath your concern is the reason I asked for a review of this PR instead of just merging it.
Actually, rule.test.test('.svg')
from https://github.com/shakacode/shakapacker#webpack-configuration (All the way at the bottom of that section) proved to be nearly as effective, so I'm going to close this PR.
Thank you both for your input.
In recent client work, I've been using this function (which I borrowed from StackOverflow here) to isolate rules for a specific module type (like CSS or SVG files) by using it like so:
While creating a function to find & apply options to a specific loader would be possible, it has proven complicated, would require several parameters, & wouldn't resolve use cases such as users seeking to remove or add loaders.
That said, I think that the regex equality test function itself would be useful to enough users to make it worthwhile to include into Shakapacker's utils (I've used it for multiple clients).