gulp task starts but does not end -
i have next files structure:
src/ themes/ default/ 1.png 2.png onemoretheme/ 3.png 4.png dist themes/ default/ onemoretheme/ and next gulpfile:
'use strict'; var gulp = require('gulp'), _ = require('lodash'), plugins = require('gulp-load-plugins')(); gulp.task('images', function () { var streams = {}, themes = [ 'default', 'onemoretheme' ]; streams.themesimages = []; _.foreach(themes, function(theme) { streams.themesimages.push(gulp.src('src/themes/' + theme + '/*.*') .pipe(gulp.dest('dist/themes/' + theme + '/'))); }); streams.allthemeimages = plugins.merge(streams.themesimages); return streams.allthemeimages; }); i can not understand 2 things: 1) why see in console next text when task "images" starts:
"d:\home\projects\storybook>gulp images [15:05:23] using gulpfile d:\home\projects\storybook\gulpfile.js [15:05:23] starting 'images'..." but when task finished not see next text:
"[12:13:56] finished 'images' after 5.72 s" why not text? streams merge , return merged stream have synchronous task. maybe wrong?
2) if add 1 code line privous code:
streams.allthemeimages = plugins.merge(streams.themesimages); return streams.allthemeimages.pipe(gulp.dest('temp/')); // here new code line i expect in temp folder i'll have next images: temp/ 1.png 2.png 3.png 4.png because merged streams, first 1 contains 1.png , 2.png images , second 1 contains 3.png , 4.png. in reality next files: temp/ 1.png 2.png wrong?
Comments
Post a Comment