Created
March 3, 2023 20:43
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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