如何获取在 gulp-jshint 中传递的文件的文件名?
最佳答案
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'));
});
关于gulp:获取正在传递的文件的文件名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29203403/