Get the current file name in gulp.src()

I’m not sure how you want to use the file names, but one of these should help: If you just want to see the names, you can use something like gulp-debug, which lists the details of the vinyl file. Insert this anywhere you want a list, like so: var gulp = require(‘gulp’), debug = require(‘gulp-debug’); … Read more

What is the ** glob character?

It’s almost the same as the single asterisk but may consist of multiple directory levels. In other words, while /x/*/y will match entries like: /x/a/y /x/b/y and so on (with only one directory level in the wildcard section), the double asterisk /x/**/y will also match things like: /x/any/number/of/levels/y with the concept of “any number of … Read more

Pass Parameter to Gulp Task

It’s a feature programs cannot stay without. You can try yargs. npm install –save-dev yargs You can use it like this: gulp mytask –production –test 1234 In the code, for example: var argv = require(‘yargs’).argv; var isProduction = (argv.production === undefined) ? false : true; For your understanding: > gulp watch console.log(argv.production === undefined); <– … Read more