Skip to content

Instantly share code, notes, and snippets.

@lukehorvat
Created March 3, 2023 20:43
Show Gist options
  • Save lukehorvat/1953f259621ceeb30300b95b5cd359ae to your computer and use it in GitHub Desktop.
Save lukehorvat/1953f259621ceeb30300b95b5cd359ae to your computer and use it in GitHub Desktop.
An example of how to print out the names of files streamed by gulp. Sometimes useful for debugging purposes.
import gulp from 'gulp';
import { Transform } from 'node:stream';
gulp.task('build', () => {
return gulp
.src('src/**/*.js')
.pipe(
new Transform({
objectMode: true,
transform(file, encoding, callback) {
console.log('FILE:', file.path);
callback(null, file);
},
})
)
.pipe(gulp.dest('dist'));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment