如何获取gulp-jshint中传递的文件的文件名?
答案 0 :(得分:3)
gulp-tap可以帮助您从gulp-src打印正在使用的文件名...
var gulp = require('gulp');
var path = require('path');
var tap = require('gulp-tap');
gulp.task('examples', function() {
return gulp.src('./examples/*.html')
.pipe(tap(function (file,t) {
console.log(path.basename(file.path));
// Do something with the file name
}))
.pipe(gulp.dest('./build'));
});