0

Using gulp I would like to have all matched files from gulp.src() in a variable.
I don't want to move files to dist I just want retrieve pattern matched files in a variable.
Something like this:

var files = gulp.src(['build/**/*.js', 'build/**/*.css']).pipe(<maybe-some-plugin-here>);

Where variable files would be an array of matched files.

I have tried using gulp-filenames but it doesn't work, just returns empty array.

Is there a, preferably simple, way to do accomplish this?

toni rmc
  • 848
  • 2
  • 10
  • 25
  • What's the goal behind this? – Emile Bergeron Jun 08 '17 at 18:52
  • I want to make "clean" task where I would delete all files from "dist" folder but only those that are matched in "build" folder. I only want to delete files in "dist" (and some folders too), not in "build". So I thought that I need list of files for that do feed it to `del` plugin. – toni rmc Jun 08 '17 at 18:57

0 Answers0