Gostaria de fazer as "tasks" abaixo rodarem simultaneamente, como devo proceder?
var gulp = require('gulp')
,clean = require('gulp-clean')
,imagemin = require('gulp-imagemin')
,cleanCSS = require('gulp-clean-css')
,minify = require('gulp-minify')
,inlinesource = require('gulp-inline-source')
,htmlmin = require('gulp-htmlmin')
,browserSync = require ('browser-sync');
gulp.task('copy', function(){
return gulp.src('src/**/*')
.pipe(gulp.dest('./dist'));
});
gulp.task('clean',function(){
return gulp.src('./dist')
.pipe(clean());
});
exports.buildImg = () => (
gulp.src('./dist/imagens/**/*.+(png|jpg|gif|jpeg)')
.pipe(imagemin())
.pipe(gulp.dest('./dist/imagens'))
);
gulp.task('minify-css', () => {
return gulp.src('./src/css/**/*.css')
.pipe(cleanCSS())
.pipe(gulp.dest('./dist/css'));
});
gulp.task('minify-js', function(cb) {
gulp.src(['./src/scripts/**/*.js'])
.pipe(minify())
.pipe(gulp.dest('./dist/scripts'))
cb();
});
gulp.task('inline', function () {
return gulp.src('./dist/**/*.html')
.pipe(inlinesource())
.pipe(gulp.dest('./dist'));
});
gulp.task('minify-html', () => {
return gulp.src('src/*.html')
.pipe(htmlmin({ collapseWhitespace: true }))
.pipe(gulp.dest('./dist'));
});
gulp.series
ourunSequence
. Já se for pra rodar simultaneamente (q me parece ser o sentido de paralelamente) usaria ogulp.parallel
gulp --version
, pega a versão do "gulp local"gulp.series()
resolve pro 4.0, se for o 3.9 vai ter que instalar o runSequence