Gulp filter. Lists all files used. Helps you to verify what your patterns catch
npm install --save-dev gulp-using
After some complex src patterns, and some added filter plugins, it helps you to list all files catched
const using = require('gulp-using')
var jsfiles = ['./src/js/**/*.js', '!./src/js/vendor/**']
gulp.task('default', function() {
gulp.watch(jsfiles, function() {
gulp.src(jsfiles)
// action or filter...
.pipe(using())
// ...
})
})Output:
[12:18:43] Running 'default'...
[12:18:43] Finished 'default' in 14 ms
[12:18:43] Using ./src/js/index.js
[12:18:43] Using ./src/js/multiply.js
[12:18:43] Using ./src/js/square.js
How the file path is displayed
- Type:
String - Default:
cwd - Values:
cwd,path,relative
How the file path is colored
- Type:
String - Default:
magenta - Values:
black,blue,cyan,gray,green,magenta,red,white,yellow
Message shown before the file path
- Type:
String - Default:
Using
Filesize shown after the file path
- Type:
Boolean - Default:
false
// ...
.pipe(using({prefix:'Using file', path:'relative', color:'blue', filesize:true}))Output:
[12:18:43] Running 'default'...
[12:18:43] Finished 'default' in 14 ms
[12:18:43] Using file index.js
[12:18:43] Using file multiply.js
[12:18:43] Using file square.js