-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
The first usage example is incorrect and gives the wrong impression about how gulp-filter matches files. #55
Comments
THANK YOU!!!! This finally fixed the problem's I'd been having trying to use this plugin, and was very confused why a single |
Perfect! 👍 |
I agree, submitting a PR would help to clean it quicker. |
The examples was incorrected. * From `'src/*.js'` to `'src/**/*.js'` * From `'*'` to `'**'`
Fix documents with references from #55
Hah! One lousy asterisk caused my problem and it took me several hours to figure it out. Thank you, @lddubeau, for posting this issue. It helped me solve a problem that was driving me crazy. |
This was fixed in leocaseiro@922496e. |
The "Usage" section on the npm page still shows the example with a single asterisk: https://www.npmjs.com/package/gulp-filter#filter-only
|
I'm referring to this
The intent seems to process everything in
src
but to exclude the files insrc/vendor
. Problems:src/*.js
won't go into subdirectories in the first place. You could remove the filter and you'd still not get anything fromsrc/vendor
intodest
.src/**/*.js
then this pattern will cover every.js
file insrc
, including subdirectories but the filter still gives the wrong impression. It does the work of excluding files insrc/vendor
not because of!src/vendor
but because of*
, which matches only files that are not in a subdirectory. You could reduce the filter togulpFilter('*')
and it would still excludesrc/vendor
and everything in it.**
instead of*
, then the filter no longer works because!src/vendor
does not match anything. Why? Becausegulp-filter
matches against the file's relative path.Ultimately, the code I see doing what the example seems to be illustrating should be:
The examples based off of this one should also be fixed.
The text was updated successfully, but these errors were encountered: