You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems annoying to have to learn the intricacies of the mini-match API in order to include and exclude 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 of include and exclude 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 @hfanode_modules directory. Would you be open to allowing regex and/or minimatch string as input to createFilter? If so, I'd be happy to put a PR together.
It seems annoying to have to learn the intricacies of the mini-match API in order to
includeandexcludeespecially 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
excludefield:/^.+\/node_modules\/(?!@hfa\/).+\.jsx?$/To only compile internal es6 modules in the
@hfanamespace. Maybe this is possible with a combination ofincludeandexcludeusing 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@hfathat may have their own internal dependency on an@hfamodule and so on, being sure to only compile the source of each module and not an commonjs module dependency inside of the@hfaor nested@hfanode_modulesdirectory. 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.