-
Notifications
You must be signed in to change notification settings - Fork 6
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
Bug: Stateful regex problem #5
Comments
I appreciate the call-out! I will evaluate this tonight, but I am curious: What benefit is there to passing a global regex as the pattern? Would it cause any issues with your usecase if we simply force the global flag to false before running the regex test? |
Fixed in Release v 1.0.1 https://github.com/swimmadude66/html-webpack-skip-assets-plugin/releases/tag/1.0.1 |
Cool! Thanks for fixing this. The benefit of having this fixed is more about predictability, I guess. |
Absolutely a good point. I ended up using |
I also forget about that all the time :) Thanks again 👍 |
When I use a regex with global flag, I get unexpected results since
rgx.test
is used to test against the asset path.See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test#using_test_on_a_regex_with_the_global_flag for details on this.
Solution would be to use
Boolean(asset.match((pattern as RegExp))
hereI'll happily provide a PR for this.
The text was updated successfully, but these errors were encountered: