Question in the comments.
var gulp = require('gulp'), plugin = require('plugin'); gulp.task('task', function(){ gulp.src(['path1', 'path2']) .pipe(plugin()); // как в вызываемом методе plugin получить // получить массив-ссылки переданные в src? }); Question in the comments.
var gulp = require('gulp'), plugin = require('plugin'); gulp.task('task', function(){ gulp.src(['path1', 'path2']) .pipe(plugin()); // как в вызываемом методе plugin получить // получить массив-ссылки переданные в src? }); In fact, these are not "links", but patterns that Gulp razimenovyvaet to the file stream. And the list of these patterns cannot be obtained in the plugin.
There is probably a question why initial patterns are needed in a plugin? In most cases, with the normal logic for creating / combining plugins, the content of the files (well, their names) is of primary importance, and not what was originally transmitted in "Gulp.src".
UPD:
By the way, array
['src/*.js', '!src/test.js'] also a valid set of patterns. :)
Source: https://ru.stackoverflow.com/questions/355912/
All Articles