-
Notifications
You must be signed in to change notification settings - Fork 17
Filters always ignore dot-files #9
Comments
FYI this may be fixed as of version 2.0.0, which uses micromatch instead of minimatch |
@Rich-Harris huh, my mistake. It won't be fixed, because that the default in micromatch too. But the fix will be to allow passing options directly to micromatch. edit: it also has |
I believe we could implement import micromatch from 'micromatch'
const createFilter = (include, exclude, options) => (id) => {
if ( typeof id !== 'string' ) return false;
if ( /\0/.test( id ) ) return false;
options = Object.assign({ ignore: exclude }, options)
return micromatch(id, include, options).length > 0
} a lot simpler and maintainable and customizable. But yea drop support for regexps, but it can be worked around too. edit: It's not only simpler and smaller, but micromatch (actually v3) handle normalization of windows paths and etc stuff, don't see sense for this |
@Rich-Harris ping? edit: i'm testing it, can confirm later. |
Are there reasons not to default to |
I guess there really is no reason to exclude them. Will see if I can prepare a small patch. |
Fix at #62 |
Sorry for reopening an old issue. The fix at #62 does not handle the case of |
Scenario: GobbleJS workflow with merge nodes, and a rollup transform with some rollup plugins, like:
Due to Gobble's merge nodes, the files are in a path containing the hidden subdirectory name
.gobble
, like:This was throwing errors in the
buble
transform, as apparently the*.txt
files were being processed byrollup-plugin-buble
, where I wanted them to be processed just byrollup-plugin-string
.Fortunately, I've been able to track down the problem to
createFilter
in therollup-pluginutils
module.See,
createFilter
usesminimatch
, and looking at its documentation I found this bit:This means that all filters for all rollup plugins are broken when rollup is used within gobble (not sure about whether other build tools use paths with dot-files for temp/hidden files).
I think I can work around the issue by specifying minimatch patterns with an explicit
.gobble/**/
for every rollup plugin, but this is totally counter-intuitive.So:
dot
setting ofminimatch
?createFilter
accept an extra set ofminimach
options?dot=true
in the rollup plugin filters?The text was updated successfully, but these errors were encountered: