Within Gulp, I am using gulp.src to select every font file from a directory:
gulp.task(\'copy-fonts\', function() {
gulp.src(\'components/**/
I would use gulp-flatten:
var flatten = require('gulp-flatten');
gulp.task('copy-fonts', function() {
gulp.src('dependencies/**/*.{ttf,woff,eof,svg}')
.pipe(flatten())
.pipe(gulp.dest('build/fonts'));
});
As to how this is done internally, check: https://github.com/armed/gulp-flatten/blob/master/index.js