This repository has been archived by the owner on Aug 4, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Allow a Regex in createFilter #5
Comments
@Rich-Harris any suggestions on this? |
@dtothefp sorry, just saw this. Would gladly accept that PR! 😀 |
@Rich-Harris is this ok ? |
This can finally be closed – v2.0.0 (major version change, so plugins will need to upgrade) supports regexes. Thanks |
Cool, thanks!! 👍 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
It seems annoying to have to learn the intricacies of the mini-match API in order to
include
andexclude
especially for people who are transitioning from a tool like Webpack, where Regex is used a lot.This is especially useful for I would think a not uncommon use case of an internal NPM registry containing un-compiled es6 modules. In Webpack for the babel-loader I'm able to use the regex below in the
exclude
field:/^.+\/node_modules\/(?!@hfa\/).+\.jsx?$/
To only compile internal es6 modules in the
@hfa
namespace. Maybe this is possible with a combination ofinclude
andexclude
using minimatch but doesn't seem user friendly to not be able to re-use regex that I'm using with another tool. In the above example I feel minimatch would be overcomplicated because you need to account for modules inside@hfa
that may have their own internal dependency on an@hfa
module and so on, being sure to only compile the source of each module and not an commonjs module dependency inside of the@hfa
or nested@hfa
node_modules
directory. Would you be open to allowing regex and/or minimatch string as input tocreateFilter
? If so, I'd be happy to put a PR together.The text was updated successfully, but these errors were encountered: