I am reading over someone's gulpfile.js
that I found, and came across an interesting character that I've not seen in file paths before; the !
symbol. I tried to do some searches for this but yielded nothing.
gulp.task("min:js", function () {
gulp.src([paths.js, "!" + paths.minJs], { base: "." })
.pipe(concat(paths.concatJsDest))
.pipe(uglify())
.pipe(gulp.dest("."));
});
Does the !
have some particular meaning, here?
I'm not an expert on Gulp, but a quick search shows that it tells gulp to ignore a given path.
Prepending a path with an exclamation mark tells Gulp to exclude that directory.
So, in your example, paths.minJs
should be excluded from the task Gulp is performing.
Actually it is used to negate a pattern, based on the answer to another question. That is, it is used to select what does not match the following pattern. As a consequence, it ignores the path in the pattern.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With