gulp.task('minify-css', function () {
gulp.src(['src/test/test.css])
.pipe(concat('test1.css'))
.pipe(minifyCSS())
.pipe(gulp.dest('src/source/'))
.pipe(filesize())
});
gulp.task('copy-css',['minify-css'], function () {
gulp.src('src/source/*.css')
.pipe(gulp.dest('src/dest/'));
});
It seems like the first time I run 'gulp copy-css'
Starting 'minify-css'...
[18:54:39] Finished 'minify-css' after 61 ms
[18:54:39] Starting 'copy-css'...
[18:54:39] Finished 'copy-css' after 1.86 ms
but the copy operation is not performed, probably because it is performed before the file to be copied is not generated
Despite the fact that I mentioned minify-css as a dependency for the copy-css task, it does not seem to conform to this convention in this case.
When gulp copy-css is run again, this time the file is copied because the file has already been created from a previously executed command. But this can exceed the goal when the code is used in production.
source
share