Answer the question
In order to leave comments, you need to log in
How to copy an array with directories from src to dest, gulp?
There are directories that I just need to copy from the src folder to build. But gulp takes only files from them and throws it in the root, if you specify 'base' it copies the entire structure including the src folder.
It should be like this:
из src/
fonts/
video/
в build/
fonts/
video/
из src/
fonts/
video/
в build/
src/
fonts/
video/
var path = {
build: {
root: 'build/',
...
},
src: {
root: 'src/',
...
files: ['src/fonts/**/*', 'src/video/**/*']
}
};
gulp.copy = function(src,dest) {
return gulp.src(src, {base: '.'})
.pipe(gulp.dest(dest));
};
gulp.task('files:prod', function() {
return gulp.copy(path.src.files, path.build.root);
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question