In order to retrieve the name of the file that is currently in use in gulp.src(), you can use the gulp-debug plugin. This plugin will log the name of each file as it passes through the gulp stream.
Here's an example of how to use the gulp-debug plugin:
const gulp = require('gulp');
const debug = require('gulp-debug');
gulp.task('myTask', function() {
return gulp.src('src/*.js')
.pipe(debug({title: 'File: '}))
.pipe(gulp.dest('dist/'));
});
In this example, the gulp.src() function is used to select all JavaScript files in the "src" directory. Then, the gulp-debug plugin is used to log the name of each file as it passes through the stream. Finally, the files are output to the "dist" directory using the gulp.dest() function.
The output in the console will show the name of each file as it is processed, prefixed with the string "File: ":
[17:22:51] File: app.js
[17:22:51] File: main.js
[17:22:51] File: plugin.js
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2023-03-23 11:00:00 +0000
Seen: 7 times
Last updated: Apr 04 '22
What is the process for generating a dynamic subdomain/URL using vue.js?
How can the style of the loader be modified while the form submission is being processed?
I'm attempting to develop a Javascript-based comments section for my website.
What are some feasible methods to enable MIDI file playback on a web browser?
How can I resolve the issue of being unable to use Fetch to POST an array of Selected Checkboxes?
What is the method to hide the scroll button when reaching the bottom?
What is the process of using a custom nunjucks filter to filter collections in an eleventy template?
What is the method to create a dynamic checkbox using API data?
How can the user id from the login object be utilized in the resolvers after logging in?