question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

gulp.src ignore option does not match documentation

See original GitHub issue

The gulp API docs indicate that gulp supports all options supported by node-glob:

gulp adds some additional options in addition to the options supported by node-glob and glob-stream:

Node-glob says it supports an ignore option.

ignore Add a pattern or an array of patterns to exclude matches.

Furthermore, node-glob says to use ignore and not to use negation:

The intent for negation would be for a pattern starting with ! to match everything that doesn’t match the supplied pattern. However, the implementation is weird. It is better to use the ignore option to set a pattern or set of patterns to exclude from matches.

However, as indicated in issue #1176, ignore does not work in gulp. Something is broken: the docs, the implementation, or both. Step one is to determine the desired state. Step two is to update the docs and/or code. What should the behavior be?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:27 (26 by maintainers)

github_iconTop GitHub Comments

1reaction
douxingcommented, Oct 29, 2015

i solve the ignore problem using another tricky way:

  1. using glob.sync with ignore option in it
  2. pass the result to the gulp.src as the first parameter
var result = glob.sync ... // choose your files the glob way
gulp.src result ... // using the files
1reaction
yocontracommented, Oct 4, 2015

Look, I don’t know what I did to personally ruin your life @jmm but you need to stop this. Every time I respond you go line by line and tear apart every word I’m saying for no reason. I’m not here to fight anyone, I don’t understand where your aggression is coming from. I’m sorry if you think I’m a dickhead based on some github issue that happened a year ago, I was probably having a shitty day. I don’t know how many times I need to apologize before you give up your vendetta.

Honestly? I closed this issue because I don’t want to deal with your needless aggression anymore and the problem is already being fixed. I don’t have time to keep writing 5 paragraph responses defending my choice of wording on issues that were posted a year ago. This discussion seems like it’s never going to end, no matter what I do to try to fix the situation. You just want to argue forever for no apparent reason. This is the last response I’m going to post, I’ll let @phated handle it from here.

I explained the reasoning behind not using the ignore option as the primary means of negation here https://github.com/gulpjs/gulp/issues/1296#issuecomment-144583691 - there is no reason to open a new issue raising the question again. Being able to evaluate globs in order is a powerful feature we’re not going to lose (grunt does this as well).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gulp.src ignore option - Stack Overflow
According to gulp api documentation, the option object is passed to node-glob, which has documented ignore option so why my code does not...
Read more >
src() - gulp.js
name type default buffer boolean function true read boolean function true since date timestamp function
Read more >
Browsersync options
Browsersync options. These are all the options that you can configure when using Browsersync. Create a single object and pass it as the...
Read more >
rollup.js
Unfortunately, JavaScript has not historically included this capability as a core ... The output option will be ignored. ... Print the help document....
Read more >
gulp-include - npm
Options · Boolean, false by default · Set this to true if you want gulp-include to throw errors if a file does not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found