Answer the question
In order to leave comments, you need to log in
Why does the task not work out completely?
Hello! Help me understand why the task does not work completely. There is a final dist directory . I created a clean task that removes the dist directory , then I created a task that collects dist , but must first perform clean . But at startup, the dist directory is deleted, and the project is not built back.
The following is in the console:
[01:30:58] Using gulpfile ~\Desktop\box\gulpfile.js
[01:30:58] Starting 'dist'...
[01:30:58] Starting 'clean'...
[01:30:58] Finished 'clean' after 52 ms
[01:30:58] Finished 'dist' after 73 ms
gulp.task('clean', function() {
return gulp.src('dist', { read: false })
.pipe(clean());
});
gulp.task('dist', gulp.series('clean'), function() {
return gulp.src('app/*.html')
.pipe(useref())
.pipe(gulpif('*.js', uglify()))
.pipe(gulpif('*.css', cleanCSS()))
.pipe(gulp.dest('dist'));
});
['clean']
to this gulp.series('clean')
. Without it, both commands work as they should ... I also tried it, the same result.
What am I doing wrong, tell me. gulp.parallel('clean')
Answer the question
In order to leave comments, you need to log in
and so?
function dist() {
return gulp.src('app/*.html')
.pipe(useref())
.pipe(gulpif('*.js', uglify()))
.pipe(gulpif('*.css', cleanCSS()))
.pipe(gulp.dest('dist'));
}
gulp.task('dist', gulp.series('clean', dist));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question