-
-
Notifications
You must be signed in to change notification settings - Fork 604
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
feat: allow modules.auto to be a filter function #1086
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1086 +/- ##
==========================================
+ Coverage 97.28% 97.29% +0.01%
==========================================
Files 10 10
Lines 479 481 +2
Branches 161 162 +1
==========================================
+ Hits 466 468 +2
Misses 12 12
Partials 1 1
Continue to review full report at Codecov.
|
@@ -117,6 +117,10 @@ function shouldUseModulesPlugins(modules, resourcePath) { | |||
return modules.auto.test(resourcePath); | |||
} | |||
|
|||
if (modules.auto instanceof Function) { | |||
return modules.auto(resourcePath); | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use typeof
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work, please add test to validate-options.test.js
too
@evilebottnawi: Thanks! I've updated it to use typeof and have added some validate-options tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, please fix CI problems
CI looks unrelated. It's failing running webpack 5 tests on node 8 thanks to BigInt not existing. That seems reasonable as they bumped their minimum version a while back: webpack/webpack#9868 Sounds like we should remove wepback 5 in node 8 from the test matrix? |
@BPScott Yes, let's test webpack@5 only for 10/12/14 |
@BPScott merged 👍 |
rebased! |
Thanks! |
Any idea when this will be released? I see that it hasn't been yet. |
ETA is the next week |
Thanks! |
@evilebottnawi is there any process we could help with to help get the updates released? |
@TheMallen Make 48 hours in one day 😄 Release will be today |
This PR contains a:
Motivation / Use-Case
The modules.auto feature as added in #1067 is pretty sweet. but sometimes you need more than a simple regex to check against your file path.
This PR allows
modules.auto
to be a function that that accepts the resourcePath and returns a boolean.Along the way I tweaked some test case names to be a little clearer about what gets passed into modules.auto, which causes a bit of snapshot diff noise.
Breaking Changes
n/a
Additional Info
n/a